mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-02-28 09:31:17 +01:00
fix: only call clearCookie for logged in users
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1,3 +1,4 @@
|
|||||||
|
dist/
|
||||||
yarn.lock
|
yarn.lock
|
||||||
npm-debug.log
|
npm-debug.log
|
||||||
node_modules/
|
node_modules/
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ module.exports = function (middleware) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Validate session
|
// Validate session
|
||||||
if (req.uid && !req.session.meta && !res.get('Set-Cookie')) {
|
if (req.uid > 0 && !req.session.meta && !res.get('Set-Cookie')) {
|
||||||
res.clearCookie(nconf.get('sessionKey'), meta.configs.cookie.get());
|
res.clearCookie(nconf.get('sessionKey'), meta.configs.cookie.get());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user