diff options
author | Sheogorath | 2017-10-31 12:11:41 +0100 |
---|---|---|
committer | GitHub | 2017-10-31 12:11:41 +0100 |
commit | 16b3e015ab3696ff61faefff30c8abfb2387e664 (patch) | |
tree | 8b3518ecebfb864ac137804b18ab295200f55f41 /lib/models | |
parent | f2812730e084d211c2d4ee9bb24cc3204ff54f51 (diff) | |
parent | 5cda55086acfc1000f0a0062045db50ad415db59 (diff) |
Merge pull request #606 from DoubleMalt/feature/MattermostAuth
Add Mattermost authentication strategy
Diffstat (limited to 'lib/models')
-rw-r--r-- | lib/models/user.js | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/models/user.js b/lib/models/user.js index e59b86cc..27566def 100644 --- a/lib/models/user.js +++ b/lib/models/user.js @@ -111,6 +111,15 @@ module.exports = function (sequelize, DataTypes) { photo = letterAvatars(profile.username) } break + case 'mattermost': + photo = profile.avatarUrl + if (photo) { + if (bigger) photo = photo.replace(/(\?s=)\d*$/i, '$1400') + else photo = photo.replace(/(\?s=)\d*$/i, '$196') + } else { + photo = letterAvatars(profile.username) + } + break case 'dropbox': // no image api provided, use gravatar photo = 'https://www.gravatar.com/avatar/' + md5(profile.emails[0].value) |