1
我使用Auth0和Heroku創建應用程序,我想創建一個只允許.edu地址能夠登錄的空白規則。但是,空白框架僅針對特定地址顯示。Heroku/Auth0規則 - 空白 - .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 = [ '[email protected]', '[email protected]' ]; //authorized users
var userHasAccess = whitelist.some(
function (email) {
return email === user.email;
});
if (!userHasAccess) {
return callback(new UnauthorizedError('Access denied.'));
}
callback(null, user, context);
}
有關如何解決如何解決此問題的任何建議? Im新的JavaScript。