mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-27 09:06:15 +01:00
fix: #8232, unresolvable session mismatch on register cancel
This commit is contained in:
@@ -195,6 +195,7 @@ authenticationController.registerComplete = function (req, res, next) {
|
|||||||
authenticationController.registerAbort = function (req, res) {
|
authenticationController.registerAbort = function (req, res) {
|
||||||
// End the session and redirect to home
|
// End the session and redirect to home
|
||||||
req.session.destroy(function () {
|
req.session.destroy(function () {
|
||||||
|
res.clearCookie(nconf.get('sessionKey'), meta.configs.cookie.get());
|
||||||
res.redirect(nconf.get('relative_path') + '/');
|
res.redirect(nconf.get('relative_path') + '/');
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
@@ -423,9 +424,7 @@ authenticationController.logout = async function (req, res, next) {
|
|||||||
req.logout();
|
req.logout();
|
||||||
|
|
||||||
await destroyAsync(req);
|
await destroyAsync(req);
|
||||||
res.clearCookie(nconf.get('sessionKey'), {
|
res.clearCookie(nconf.get('sessionKey'), meta.configs.cookie.get());
|
||||||
path: nconf.get('relative_path'),
|
|
||||||
});
|
|
||||||
req.uid = 0;
|
req.uid = 0;
|
||||||
req.headers['x-csrf-token'] = req.csrfToken();
|
req.headers['x-csrf-token'] = req.csrfToken();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user