fix: save and send cookie in dev setup
This commit is contained in:
@@ -17,11 +17,10 @@ router.post('/login', async (req, res) => {
|
||||
|
||||
// successfully authenticated
|
||||
res.cookie('jwt', 'toekn', {
|
||||
/*
|
||||
httpOnly: true, // Prevent XSS
|
||||
secure: true, // HTTPS only
|
||||
sameSite: 'strict', // CSRF protection
|
||||
*/
|
||||
secure: false, // HTTPS only
|
||||
sameSite: 'lax', // CSRF protection
|
||||
domain: '.localhost',
|
||||
maxAge: 86400000, // 1 day
|
||||
});
|
||||
res.json({ message: 'Logged in successfully' });
|
||||
@@ -37,7 +36,6 @@ router.post('/logout', (req, res) => {
|
||||
});
|
||||
|
||||
router.get('/status', (req, res) => {
|
||||
console.log(req.cookies);
|
||||
if (isAuthenticated(req)){
|
||||
return res.status(200).json({authenticated: true});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user