feat: SAML auth module

This commit is contained in:
Nick
2019-04-27 21:42:04 -04:00
parent a034295b2c
commit bdfac22876
4 changed files with 97 additions and 32 deletions

View File

@@ -14,14 +14,16 @@ router.get('/login', (req, res, next) => {
})
router.get('/login/:strategy', async (req, res, next) => {
try {
const authResult = await WIKI.models.users.login({
await WIKI.models.users.login({
strategy: req.params.strategy
}, { req, res })
} catch (err) {
next(err)
}
})
router.get('/login/:strategy/callback', async (req, res, next) => {
router.all('/login/:strategy/callback', async (req, res, next) => {
if (req.method !== 'GET' && req.method !== 'POST') { return next() }
try {
const authResult = await WIKI.models.users.login({
strategy: req.params.strategy