mirror of
https://github.com/zoriya/flood.git
synced 2026-06-08 04:41:03 +00:00
server: auth: strictly prohibit cross-site cookie
Flood instances are not going to be linked from another site. This prevents Cross-Site Request Forgery attacks which exploits cached authentication token in cookie.
This commit is contained in:
@@ -22,7 +22,7 @@ const setAuthToken = (res, username, isAdmin) => {
|
||||
expiresIn: expirationSeconds,
|
||||
});
|
||||
|
||||
res.cookie('jwt', token, {expires: new Date(cookieExpiration), httpOnly: true});
|
||||
res.cookie('jwt', token, {expires: new Date(cookieExpiration), httpOnly: true, sameSite: 'Strict'});
|
||||
|
||||
return res.json({
|
||||
success: true,
|
||||
|
||||
Reference in New Issue
Block a user