mirror of
https://github.com/aljazceru/landscape-template.git
synced 2025-12-17 22:34:21 +01:00
refactor: migrate to jwt sessions instead of store sessions
This commit is contained in:
@@ -3,11 +3,15 @@ const { createExpressApp } = require('../../modules');
|
||||
const express = require('express');
|
||||
|
||||
const logoutHandler = (req, res, next) => {
|
||||
if (req.user) {
|
||||
req.session.destroy();
|
||||
return res.redirect("/");
|
||||
}
|
||||
next();
|
||||
|
||||
res
|
||||
.clearCookie('Authorization', {
|
||||
secure: true,
|
||||
httpOnly: true,
|
||||
})
|
||||
.redirect("/")
|
||||
.end()
|
||||
|
||||
};
|
||||
|
||||
let app;
|
||||
|
||||
Reference in New Issue
Block a user