summaryrefslogtreecommitdiff
path: root/lib/models
diff options
context:
space:
mode:
authorNorihito Nakae2017-11-28 12:46:58 +0900
committerNorihito Nakae2017-11-28 18:52:24 +0900
commit4a4ae9d332cff31991d9f63417895fce18717f61 (patch)
tree21d61db281bd6ebd588a6f1eaabce46f7a067f10 /lib/models
parent9c002ce29bf422b5bc136c2028b2fb05e2ab8278 (diff)
Initial support for SAML authentication
Diffstat (limited to 'lib/models')
-rw-r--r--lib/models/user.js9
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
},