feat: modular auth + logging changes
This commit is contained in:
@@ -8,20 +8,18 @@
|
||||
|
||||
const WindowsLiveStrategy = require('passport-windowslive').Strategy
|
||||
|
||||
module.exports = (passport) => {
|
||||
if (wiki.config.auth.microsoft && wiki.config.auth.microsoft.enabled) {
|
||||
passport.use('windowslive',
|
||||
new WindowsLiveStrategy({
|
||||
clientID: wiki.config.auth.microsoft.clientId,
|
||||
clientSecret: wiki.config.auth.microsoft.clientSecret,
|
||||
callbackURL: wiki.config.host + '/login/ms/callback'
|
||||
}, function (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('windowslive',
|
||||
new WindowsLiveStrategy({
|
||||
clientID: conf.clientId,
|
||||
clientSecret: conf.clientSecret,
|
||||
callbackURL: conf.callbackURL
|
||||
}, function (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