fix add github link to passport
This commit is contained in:
@ -79,7 +79,7 @@ export default function(UserIdent) {
|
||||
}
|
||||
|
||||
// if user signed in with github refresh their info
|
||||
if (userIdent.provider === 'github-login') {
|
||||
if (/github/.test(userIdent.provider)) {
|
||||
debug("user isn't github cool or username from github is different");
|
||||
setProfileFromGithub(user, profile, profile._json);
|
||||
userChanged = true;
|
||||
|
@ -141,5 +141,19 @@ module.exports = {
|
||||
clientSecret: process.env.GITHUB_SECRET,
|
||||
scope: ['email'],
|
||||
failureFlash: true
|
||||
},
|
||||
'github-link': {
|
||||
provider: 'github',
|
||||
authScheme: 'oauth2',
|
||||
module: 'passport-github',
|
||||
authPath: '/link/github',
|
||||
callbackURL: '/link/github/callback',
|
||||
callbackPath: '/link/github/callback',
|
||||
successRedirect: successRedirect,
|
||||
failureRedirect: failureRedirect,
|
||||
clientID: process.env.GITHUB_ID,
|
||||
clientSecret: process.env.GITHUB_SECRET,
|
||||
scope: ['email'],
|
||||
failureFlash: true
|
||||
}
|
||||
};
|
||||
|
@ -102,7 +102,7 @@ var passportOptions = {
|
||||
userObj.email = email;
|
||||
}
|
||||
|
||||
if (provider === 'github-login') {
|
||||
if (/github/.test(provider)) {
|
||||
setProfileFromGithub(userObj, profile, profile._json);
|
||||
}
|
||||
return userObj;
|
||||
|
Reference in New Issue
Block a user