123456789101112131415161718192021 |
- 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)}`);
- }
|