1
0
Fork 0
mirror of https://code.forgejo.org/actions/setup-node synced 2025-06-24 20:28:01 +02:00
setup-node/node_modules/@octokit/rest/plugins/authentication/validate.js

22 lines
350 B
JavaScript
Raw Normal View History

2019-08-06 18:29:44 -04:00
module.exports = validateAuth
function validateAuth (auth) {
if (typeof auth === 'string') {
return
}
if (typeof auth === 'function') {
return
}
if (auth.username && auth.password) {
return
}
if (auth.clientId && auth.clientSecret) {
return
}
throw new Error(`Invalid "auth" option: ${JSON.stringify(auth)}`)
}