feat: social login providers with dynamic instances

This commit is contained in:
NGPixel
2020-08-30 01:36:17 -04:00
parent a7ddafd4aa
commit 32d67adee1
28 changed files with 147 additions and 107 deletions

View File

@@ -28,7 +28,7 @@ module.exports = {
usernameField: 'email',
passwordField: 'password',
passReqToCallback: false
}, async (profile, cb) => {
}, async (req, profile, cb) => {
try {
const userId = _.get(profile, conf.mappingUID, null)
if (!userId) {
@@ -36,13 +36,13 @@ module.exports = {
}
const user = await WIKI.models.users.processProfile({
providerKey: req.params.strategy,
profile: {
id: userId,
email: String(_.get(profile, conf.mappingEmail, '')).split(',')[0],
displayName: _.get(profile, conf.mappingDisplayName, '???'),
picture: _.get(profile, conf.mappingPicture, '')
},
providerKey: 'ldap'
}
})
cb(null, user)
} catch (err) {