fix prevent crash from user migrated profiles
This commit is contained in:
@ -158,14 +158,14 @@ export default function(UserIdent) {
|
|||||||
userChanged = true;
|
userChanged = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(/github/).test(provider)) {
|
if (!(/github/).test(provider) && profile) {
|
||||||
debug('setting social', provider, (/github/g).test(provider));
|
debug('setting social', provider, (/github/g).test(provider));
|
||||||
debug('profile username', profile.username);
|
debug('profile username', profile.username);
|
||||||
user[provider] = profile.username;
|
user[provider] = profile.username;
|
||||||
}
|
}
|
||||||
|
|
||||||
// if user signed in with github refresh their info
|
// if user signed in with github refresh their info
|
||||||
if (/github/.test(provider)) {
|
if (/github/.test(provider) && profile && profile._json) {
|
||||||
debug("user isn't github cool or username from github is different");
|
debug("user isn't github cool or username from github is different");
|
||||||
setProfileFromGithub(user, profile, profile._json);
|
setProfileFromGithub(user, profile, profile._json);
|
||||||
userChanged = true;
|
userChanged = true;
|
||||||
|
Reference in New Issue
Block a user