mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 06:37:23 +01:00
Automatically Logout Banned Users (#12037)
* wip * logout banned users, fix and refactor language library and middleware * req.locals -> res.locals * fix tests * redirect to login page
This commit is contained in:
@@ -28,7 +28,9 @@ api.logout = {
|
||||
async handler (req, res) {
|
||||
if (req.logout) req.logout(); // passportjs method
|
||||
req.session = null;
|
||||
res.redirect('/');
|
||||
|
||||
const redirectUrl = req.query.redirectToLogin === 'true' ? '/login' : '/';
|
||||
res.redirect(redirectUrl);
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user