|
|
@ -20,12 +20,13 @@ module.exports = {
|
|
|
|
scope: ['profile', 'email', 'openid'],
|
|
|
|
scope: ['profile', 'email', 'openid'],
|
|
|
|
allowHttpForRedirectUrl: WIKI.IS_DEBUG
|
|
|
|
allowHttpForRedirectUrl: WIKI.IS_DEBUG
|
|
|
|
}, async (iss, sub, profile, cb) => {
|
|
|
|
}, async (iss, sub, profile, cb) => {
|
|
|
|
|
|
|
|
const usrEmail = _.get(profile, '_json.email', null) || _.get(profile, '_json.preferred_username')
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
const user = await WIKI.models.users.processProfile({
|
|
|
|
const user = await WIKI.models.users.processProfile({
|
|
|
|
profile: {
|
|
|
|
profile: {
|
|
|
|
id: profile.oid,
|
|
|
|
id: profile.oid,
|
|
|
|
displayName: profile.displayName,
|
|
|
|
displayName: profile.displayName,
|
|
|
|
email: _.get(profile, '_json.email', ''),
|
|
|
|
email: usrEmail,
|
|
|
|
picture: ''
|
|
|
|
picture: ''
|
|
|
|
},
|
|
|
|
},
|
|
|
|
providerKey: 'azure'
|
|
|
|
providerKey: 'azure'
|
|
|
|