summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorWu Cheng-Han2017-02-18 20:07:15 +0800
committerWu Cheng-Han2017-02-18 20:07:15 +0800
commit2aee0f267c2154ddf001507a62e4fe548515cd3a (patch)
treefda385baecd37f7b82c58a419a10f20e64089dbe /lib
parent1ca39d9c8e47ae2ce5a524504beb0aaed221a97c (diff)
Fix user profile photo might not replace to proper size
Diffstat (limited to 'lib')
-rw-r--r--lib/models/user.js8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/models/user.js b/lib/models/user.js
index aee42041..dd93bf78 100644
--- a/lib/models/user.js
+++ b/lib/models/user.js
@@ -105,8 +105,8 @@ module.exports = function (sequelize, DataTypes) {
break;
case "gitlab":
photo = profile.avatarUrl;
- if (bigger) photo.replace(/(\?s=)\d*$/i, '$1400');
- else photo.replace(/(\?s=)\d*$/i, '$196');
+ if (bigger) photo = photo.replace(/(\?s=)\d*$/i, '$1400');
+ else photo = photo.replace(/(\?s=)\d*$/i, '$196');
break;
case "dropbox":
//no image api provided, use gravatar
@@ -116,8 +116,8 @@ module.exports = function (sequelize, DataTypes) {
break;
case "google":
photo = profile.photos[0].value;
- if (bigger) photo.replace(/(\?sz=)\d*$/i, '$1400');
- else photo.replace(/(\?sz=)\d*$/i, '$196');
+ if (bigger) photo = photo.replace(/(\?sz=)\d*$/i, '$1400');
+ else photo = photo.replace(/(\?sz=)\d*$/i, '$196');
break;
case "ldap":
//no image api provided,