static async authenticate (user) { let creds = (await config.storage.get('htpasswd')) || '' let auth = await htpasswd.authenticate(user.name, user.password, creds.toString()) if (!auth) return false return createAuthToken(user.name) }
function* authenticate (user) { let creds = (yield s3.download('/htpasswd')) || ''; let auth = yield htpasswd.authenticate(user.name, user.password, creds); if (!auth) { return false; } return yield createAuthToken(user.name); }