mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-09-10 04:30:23 +02:00
fix: bug that allowed for bypass of GDPR interstitial on SSO registrations simply by cancelling the form
This commit is contained in:
@@ -209,18 +209,22 @@ authenticationController.registerComplete = async function (req, res) {
|
||||
}
|
||||
};
|
||||
|
||||
authenticationController.registerAbort = function (req, res) {
|
||||
authenticationController.registerAbort = async (req, res) => {
|
||||
if (req.uid) {
|
||||
// Clear interstitial data and continue on...
|
||||
delete req.session.registration;
|
||||
res.redirect(nconf.get('relative_path') + (req.session.returnTo || '/'));
|
||||
} else {
|
||||
// End the session and redirect to home
|
||||
req.session.destroy(() => {
|
||||
res.clearCookie(nconf.get('sessionKey'), meta.configs.cookie.get());
|
||||
res.redirect(`${nconf.get('relative_path')}/`);
|
||||
});
|
||||
// Email is the only cancelable interstitial
|
||||
delete req.session.registration.updateEmail;
|
||||
|
||||
const { interstitials } = await user.interstitials.get(req, req.session.registration);
|
||||
if (!interstitials.length) {
|
||||
return res.redirect(nconf.get('relative_path') + (req.session.returnTo || '/'));
|
||||
}
|
||||
}
|
||||
|
||||
// End the session and redirect to home
|
||||
req.session.destroy(() => {
|
||||
res.clearCookie(nconf.get('sessionKey'), meta.configs.cookie.get());
|
||||
res.redirect(`${nconf.get('relative_path')}/`);
|
||||
});
|
||||
};
|
||||
|
||||
authenticationController.login = async (req, res, next) => {
|
||||
|
||||
Reference in New Issue
Block a user