|
|
|
@ -37,12 +37,16 @@ module.exports = {
|
|
|
|
|
useCookieInsteadOfSession: keyArray.length > 0,
|
|
|
|
|
cookieEncryptionKeys: keyArray
|
|
|
|
|
}, async (req, iss, sub, profile, cb) => {
|
|
|
|
|
const usrEmail = _.get(profile, '_json.email', null) || _.get(profile, '_json.preferred_username')
|
|
|
|
|
const emails = _.get(profile, '_json.emails', null);
|
|
|
|
|
const id = _.get(profile, '_json.sub', null);
|
|
|
|
|
|
|
|
|
|
const usrEmail = _.get(profile, '_json.email', null) || _.get(profile, '_json.preferred_username') || emails[0]
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
const user = await WIKI.models.users.processProfile({
|
|
|
|
|
providerKey: req.params.strategy,
|
|
|
|
|
profile: {
|
|
|
|
|
id: profile.oid,
|
|
|
|
|
id: profile.oid || id,
|
|
|
|
|
displayName: profile.displayName,
|
|
|
|
|
email: usrEmail,
|
|
|
|
|
picture: ''
|
|
|
|
|