feat(api): add custom redirect back
This commit is contained in:
committed by
mrugesh
parent
3823ed19bc
commit
aa62fdbfe9
@ -54,8 +54,19 @@ module.exports = function enableAuthentication(app) {
|
||||
} else {
|
||||
api.get(
|
||||
'/signin',
|
||||
(req, res, next) => {
|
||||
if (req && req.query && req.query.returnTo) {
|
||||
req.query.returnTo = `${homeLocation}/${req.query.returnTo}`;
|
||||
}
|
||||
return next();
|
||||
},
|
||||
ifUserRedirect,
|
||||
passport.authenticate('auth0-login', {})
|
||||
(req, res, next) => {
|
||||
const state = req.query.returnTo
|
||||
? Buffer.from(req.query.returnTo).toString('base64')
|
||||
: null;
|
||||
return passport.authenticate('auth0-login', { state })(req, res, next);
|
||||
}
|
||||
);
|
||||
|
||||
api.get(
|
||||
|
Reference in New Issue
Block a user