|
|
@ -21,12 +21,16 @@ module.exports = {
|
|
|
|
clientSecret: conf.clientSecret,
|
|
|
|
clientSecret: conf.clientSecret,
|
|
|
|
callbackURL: conf.callbackURL
|
|
|
|
callbackURL: conf.callbackURL
|
|
|
|
}, async (accessToken, refreshToken, profile, cb) => {
|
|
|
|
}, async (accessToken, refreshToken, profile, cb) => {
|
|
|
|
|
|
|
|
let displayName = profile.username
|
|
|
|
|
|
|
|
if (_.isString(profile.fullName) && profile.fullName.length > 0) {
|
|
|
|
|
|
|
|
displayName = profile.fullName
|
|
|
|
|
|
|
|
}
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
const user = await WIKI.models.users.processProfile({
|
|
|
|
const user = await WIKI.models.users.processProfile({
|
|
|
|
profile: {
|
|
|
|
profile: {
|
|
|
|
id: profile.keycloakId,
|
|
|
|
id: profile.keycloakId,
|
|
|
|
email: profile.email,
|
|
|
|
email: profile.email,
|
|
|
|
name: profile.username,
|
|
|
|
name: displayName,
|
|
|
|
picture: ''
|
|
|
|
picture: ''
|
|
|
|
},
|
|
|
|
},
|
|
|
|
providerKey: 'keycloak'
|
|
|
|
providerKey: 'keycloak'
|
|
|
|