Initial support for SAML authentication

This commit is contained in:
Norihito Nakae 2017-11-28 12:46:58 +09:00
parent 9c002ce29b
commit 4a4ae9d332
12 changed files with 157 additions and 4 deletions

View file

@ -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
},