feat: modular auth + logging changes
This commit is contained in:
@@ -8,20 +8,18 @@
|
||||
|
||||
const SlackStrategy = require('passport-slack').Strategy
|
||||
|
||||
module.exports = (passport) => {
|
||||
if (wiki.config.auth.slack && wiki.config.auth.slack.enabled) {
|
||||
passport.use('slack',
|
||||
new SlackStrategy({
|
||||
clientID: wiki.config.auth.slack.clientId,
|
||||
clientSecret: wiki.config.auth.slack.clientSecret,
|
||||
callbackURL: wiki.config.host + '/login/slack/callback'
|
||||
}, (accessToken, refreshToken, profile, cb) => {
|
||||
wiki.db.User.processProfile(profile).then((user) => {
|
||||
return cb(null, user) || true
|
||||
}).catch((err) => {
|
||||
return cb(err, null) || true
|
||||
})
|
||||
}
|
||||
))
|
||||
}
|
||||
module.exports = (passport, conf) => {
|
||||
passport.use('slack',
|
||||
new SlackStrategy({
|
||||
clientID: conf.clientId,
|
||||
clientSecret: conf.clientSecret,
|
||||
callbackURL: conf.callbackURL
|
||||
}, (accessToken, refreshToken, profile, cb) => {
|
||||
wiki.db.User.processProfile(profile).then((user) => {
|
||||
return cb(null, user) || true
|
||||
}).catch((err) => {
|
||||
return cb(err, null) || true
|
||||
})
|
||||
}
|
||||
))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user