Commit 692e5ca0 authored by NGPixel's avatar NGPixel

fix: use preferred_username as alternate for Azure AD

parent e5774a89
......@@ -20,12 +20,13 @@ module.exports = {
scope: ['profile', 'email', 'openid'],
allowHttpForRedirectUrl: WIKI.IS_DEBUG
}, async (iss, sub, profile, cb) => {
const usrEmail = _.get(profile, '_json.email', null) || _.get(profile, '_json.preferred_username')
try {
const user = await WIKI.models.users.processProfile({
profile: {
id: profile.oid,
displayName: profile.displayName,
email: _.get(profile, '_json.email', ''),
email: usrEmail,
picture: ''
},
providerKey: 'azure'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment