コード例 #1
0
ファイル: user.js プロジェクト: dickeyxxx/npm-register
 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)
 }
コード例 #2
0
ファイル: user.js プロジェクト: cherepanov/elephant
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);
}