feat: auth0 + discord + github + slack auth modules

This commit is contained in:
Nick
2019-04-21 21:43:33 -04:00
parent 8af21c02af
commit d7676513ac
20 changed files with 286 additions and 99 deletions

View File

@@ -13,12 +13,20 @@ module.exports = {
clientID: conf.clientId,
clientSecret: conf.clientSecret,
callbackURL: conf.callbackURL
}, function (accessToken, refreshToken, profile, cb) {
WIKI.models.users.processProfile(profile).then((user) => {
return cb(null, user) || true
}).catch((err) => {
return cb(err, null) || true
})
}, async (accessToken, refreshToken, profile, cb) => {
console.info(profile)
try {
const user = await WIKI.models.users.processProfile({
profile: {
...profile,
picture: _.get(profile, 'photos[0].value', '')
},
providerKey: 'microsoft'
})
cb(null, user)
} catch (err) {
cb(err, null)
}
}
))
}

View File

@@ -5,7 +5,20 @@ author: requarks.io
logo: https://static.requarks.io/logo/microsoft.svg
color: blue
website: https://apps.dev.microsoft.com/
isAvailable: false
useForm: false
scopes:
- openid
- profile
- email
props:
clientId: String
clientSecret: String
clientId:
type: String
title: Client ID
hint: Application Client ID
order: 1
clientSecret:
type: String
title: Client Secret
hint: Application Client Secret
order: 2