mirror of
https://code.forgejo.org/actions/setup-node.git
synced 2024-11-24 19:20:57 -05:00
21 lines
350 B
JavaScript
21 lines
350 B
JavaScript
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)}`)
|
|
}
|