From 4a4ae9d332cff31991d9f63417895fce18717f61 Mon Sep 17 00:00:00 2001 From: Norihito Nakae Date: Tue, 28 Nov 2017 12:46:58 +0900 Subject: Initial support for SAML authentication --- lib/models/user.js | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'lib/models') 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 }, -- cgit v1.2.3