1
0
Fork 0
mirror of https://github.com/openstf/stf synced 2025-10-05 10:39:25 +02:00

More reliably extract user's email address.

This commit is contained in:
Simo Kinnunen 2014-01-24 14:32:34 +09:00
parent 8d7cfa57c4
commit 97f37ad507
2 changed files with 6 additions and 1 deletions

View file

@ -51,7 +51,7 @@ module.exports = function(options) {
log.info('Authenticated "%s"', user.userPrincipalName)
var token = jwtutil.encode({
payload: {
email: user.userPrincipalName
email: ldaputil.email(user)
, name: user.cn
}
, secret: options.secret

View file

@ -109,3 +109,8 @@ module.exports.login = function(options, username, password) {
})
})
}
// Export
module.exports.email = function(user) {
return user.mail || user.email || user.userPrincipalName
}