diff options
author | Christoph (Sheogorath) Kern | 2017-12-04 18:57:57 +0100 |
---|---|---|
committer | GitHub | 2017-12-04 18:57:57 +0100 |
commit | 0957f5963b735e9ccde4098265c7fab13dbb216b (patch) | |
tree | 63e288eb3abe096a0156fae96b4be646a9619ffb /lib/models | |
parent | 8112cd6fef740c3bf8f535de860c2e7b8dd51834 (diff) | |
parent | 2db2ff484fb0911ea699c7fc59b8b1ad868ca992 (diff) |
Merge pull request #633 from nakaeeee/saml-auth
Support SAML authentication
Diffstat (limited to '')
-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 27566def..f421fe43 100644 --- a/lib/models/user.js +++ b/lib/models/user.js @@ -143,6 +143,15 @@ module.exports = function (sequelize, DataTypes) { photo = letterAvatars(profile.username) } break + case 'saml': + if (profile.emails[0]) { + photo = 'https://www.gravatar.com/avatar/' + md5(profile.emails[0]) + if (bigger) photo += '?s=400' + else photo += '?s=96' + } else { + photo = letterAvatars(profile.username) + } + break } return photo }, |