mirror of
https://github.com/cnodejs/nodeclub.git
synced 2025-12-08 19:55:55 +00:00
fix TypeError when profile without emails
This commit is contained in:
parent
dd98208cd2
commit
c652c28df1
@ -19,7 +19,7 @@ exports.callback = function (req, res, next) {
|
||||
user.githubAccessToken = profile.accessToken;
|
||||
// user.loginname = profile.username;
|
||||
user.avatar = profile._json.avatar_url;
|
||||
if (profile.emails[0].value) {
|
||||
if (profile.emails && profile.emails[0] && profile.emails[0].value) {
|
||||
user.email = profile.emails[0].value;
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user