-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Open
Description
Is it possible to pass the route to the login function? For example to check that only a user with special role like admin can access a spcial page?
My Ideas is to check this at this point:
function isLoggedIn(req, res, next) {
// if user is authenticated
//and when route/page = admin user must have role admin
if (req.isAuthenticated()) {
return next();
}
// if they aren't redirect them to the home page
res.redirect('/');
}
Or is there another way? Thank you!
Metadata
Metadata
Assignees
Labels
No labels