use https profile image url in twitter auth
This commit is contained in:
@@ -204,7 +204,7 @@ passport.use(new TwitterStrategy(secrets.twitter, function(req, accessToken, tok
|
|||||||
user.tokens.push({ kind: 'twitter', accessToken: accessToken, tokenSecret: tokenSecret });
|
user.tokens.push({ kind: 'twitter', accessToken: accessToken, tokenSecret: tokenSecret });
|
||||||
user.profile.name = user.profile.name || profile.displayName;
|
user.profile.name = user.profile.name || profile.displayName;
|
||||||
user.profile.location = user.profile.location || profile._json.location;
|
user.profile.location = user.profile.location || profile._json.location;
|
||||||
user.profile.picture = user.profile.picture || profile._json.profile_image_url;
|
user.profile.picture = user.profile.picture || profile._json.profile_image_url_https;
|
||||||
user.save(function(err) {
|
user.save(function(err) {
|
||||||
req.flash('info', { msg: 'Twitter account has been linked.' });
|
req.flash('info', { msg: 'Twitter account has been linked.' });
|
||||||
done(err, user);
|
done(err, user);
|
||||||
@@ -225,7 +225,7 @@ passport.use(new TwitterStrategy(secrets.twitter, function(req, accessToken, tok
|
|||||||
user.tokens.push({ kind: 'twitter', accessToken: accessToken, tokenSecret: tokenSecret });
|
user.tokens.push({ kind: 'twitter', accessToken: accessToken, tokenSecret: tokenSecret });
|
||||||
user.profile.name = profile.displayName;
|
user.profile.name = profile.displayName;
|
||||||
user.profile.location = profile._json.location;
|
user.profile.location = profile._json.location;
|
||||||
user.profile.picture = profile._json.profile_image_url;
|
user.profile.picture = profile._json.profile_image_url_https;
|
||||||
user.save(function(err) {
|
user.save(function(err) {
|
||||||
done(err, user);
|
done(err, user);
|
||||||
});
|
});
|
||||||
|
Reference in New Issue
Block a user