summaryrefslogtreecommitdiff
path: root/lib/models
diff options
context:
space:
mode:
authorCheng-Han, Wu2016-05-21 22:48:00 +0800
committerCheng-Han, Wu2016-05-21 22:48:00 +0800
commit6405bb505695a5592efe8aa8d5bde9e723fadfc0 (patch)
tree882c74f212d4892ae0013d5ab394404f096b693b /lib/models
parent900141daff05feeeaae5f537d2f53862b7200651 (diff)
Add support of google signin
Diffstat (limited to 'lib/models')
-rw-r--r--lib/models/user.js3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/models/user.js b/lib/models/user.js
index 237532c1..3142a53d 100644
--- a/lib/models/user.js
+++ b/lib/models/user.js
@@ -76,6 +76,9 @@ module.exports = function (sequelize, DataTypes) {
//no image api provided, use gravatar
photo = 'https://www.gravatar.com/avatar/' + md5(profile.emails[0].value);
break;
+ case "google":
+ photo = profile.photos[0].value.replace(/(\?sz=)\d*$/i, '$196');
+ break;
}
return photo;
}