1

Auth0 と Heroku を使用してアプリケーションを作成しています。.edu アドレスのみがログインできるようにする空白ルールを作成したいと考えています。ただし、空白のスケルトンは特定のアドレスに対してのみ表示されます。

function (user, context, callback) {
    //we just care about NameOfTheAppWithWhiteList
    //bypass this rule for every other app
    if(context.clientName !== 'NameOfTheAppWithWhiteList'){
      return callback(null, user, context);
    }

var whitelist = [ 'user1@mail.com', 'user2@mail.com' ]; //authorized users
var userHasAccess = whitelist.some(
  function (email) {
    return email === user.email;
  });

if (!userHasAccess) {
  return callback(new UnauthorizedError('Access denied.'));
}

callback(null, user, context);
}  

この問題を解決する方法を理解する方法について何かアドバイスはありますか? JavaScript は初めてです。

4

2 に答える 2