Ejemplo n.º 1
0
 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)
 }
Ejemplo n.º 2
0
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);
}