Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function (user, context, callback) {
- // We check users only authenticated with 'github'
- if(context.connection === 'github'){
- var whitelist = [
- 'bcoe',
- 'batman'
- ]; //authorized github accounts.
- var userHasAccess = whitelist.some((name) => {
- return name === user.nickname;
- });
- if (!userHasAccess) {
- return callback(new UnauthorizedError('Access denied.'));
- }
- }
- callback(null, user, context);
- }
Add Comment
Please, Sign In to add comment