This commit is contained in:
eric sciple 2020-01-24 12:20:19 -05:00
parent beb1329f9f
commit 2b95e76931
7736 changed files with 1874747 additions and 51184 deletions

View file

@ -1,21 +1,21 @@
module.exports = validateAuth
module.exports = validateAuth;
function validateAuth (auth) {
if (typeof auth === 'string') {
return
function validateAuth(auth) {
if (typeof auth === "string") {
return;
}
if (typeof auth === 'function') {
return
if (typeof auth === "function") {
return;
}
if (auth.username && auth.password) {
return
return;
}
if (auth.clientId && auth.clientSecret) {
return
return;
}
throw new Error(`Invalid "auth" option: ${JSON.stringify(auth)}`)
throw new Error(`Invalid "auth" option: ${JSON.stringify(auth)}`);
}