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

@@ -13,10 +13,14 @@ module.exports = {
domain: conf.domain,
clientID: conf.clientId,
clientSecret: conf.clientSecret,
callbackURL: conf.callbackURL
}, async (accessToken, refreshToken, extraParams, profile, cb) => {
callbackURL: conf.callbackURL,
passReqToCallback: true
}, async (req, accessToken, refreshToken, extraParams, profile, cb) => {
try {
const user = await WIKI.models.users.processProfile({ profile, providerKey: 'auth0' })
const user = await WIKI.models.users.processProfile({
providerKey: req.params.strategy,
profile
})
cb(null, user)
} catch (err) {
cb(err, null)