Коммит
acabc27a33
|
@ -167,9 +167,9 @@ function addAuthRoutes() {
|
||||||
|
|
||||||
// GET /auth/openid/return
|
// GET /auth/openid/return
|
||||||
// Use passport.authenticate() as route middleware to authenticate the
|
// Use passport.authenticate() as route middleware to authenticate the
|
||||||
// request. If authentication fails, the user will be redirected back to the
|
// request. If authentication fails, the user will be redirected back to the
|
||||||
// login page. Otherwise, the primary route function function will be called,
|
// sign-in page. Otherwise, the primary route function will be called.
|
||||||
// which, in this example, will redirect the user to the home page.
|
// In this example, it redirects the user to the home page.
|
||||||
router.get('/openid/return',
|
router.get('/openid/return',
|
||||||
passport.authenticate('azuread-openidconnect', { failureRedirect: '/auth/login' }),
|
passport.authenticate('azuread-openidconnect', { failureRedirect: '/auth/login' }),
|
||||||
function(req, res) {
|
function(req, res) {
|
||||||
|
@ -178,11 +178,11 @@ function addAuthRoutes() {
|
||||||
redirectPath = null;
|
redirectPath = null;
|
||||||
});
|
});
|
||||||
|
|
||||||
// GET /auth/openid/return
|
// POST /auth/openid/return
|
||||||
// Use passport.authenticate() as route middleware to authenticate the
|
// Use passport.authenticate() as route middleware to authenticate the
|
||||||
// request. If authentication fails, the user will be redirected back to the
|
// request. If authentication fails, the user will be redirected back to the
|
||||||
// login page. Otherwise, the primary route function function will be called,
|
// sign-in page. Otherwise, the primary route function will be called.
|
||||||
// which, in this example, will redirect the user to the home page.
|
// In this example, it will redirect the user to the home page.
|
||||||
router.post('/openid/return',
|
router.post('/openid/return',
|
||||||
passport.authenticate('azuread-openidconnect', { failureRedirect: '/auth/login' }),
|
passport.authenticate('azuread-openidconnect', { failureRedirect: '/auth/login' }),
|
||||||
function(req, res) {
|
function(req, res) {
|
||||||
|
@ -278,4 +278,4 @@ module.exports = {
|
||||||
// Returning a middleware array
|
// Returning a middleware array
|
||||||
authenticationMiddleware,
|
authenticationMiddleware,
|
||||||
router
|
router
|
||||||
}
|
}
|
||||||
|
|
Загрузка…
Ссылка в новой задаче