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:
parent
8d7cfa57c4
commit
97f37ad507
2 changed files with 6 additions and 1 deletions
|
@ -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
|
||||
|
|
|
@ -109,3 +109,8 @@ module.exports.login = function(options, username, password) {
|
|||
})
|
||||
})
|
||||
}
|
||||
|
||||
// Export
|
||||
module.exports.email = function(user) {
|
||||
return user.mail || user.email || user.userPrincipalName
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue