mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 16:46:12 +01:00
feat: return generic 404 on invalid confirm code
This commit is contained in:
@@ -222,12 +222,19 @@ Controllers.registerInterstitial = async function (req, res, next) {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
Controllers.confirmEmail = function (req, res) {
|
Controllers.confirmEmail = async (req, res, next) => {
|
||||||
user.email.confirmByCode(req.params.code, (err) => {
|
try {
|
||||||
res.render('confirm', {
|
await user.email.confirmByCode(req.params.code, req.session.id);
|
||||||
error: err ? err.message : '',
|
} catch (e) {
|
||||||
title: '[[pages:confirm]]',
|
if (e.message === '[[error:invalid-data]]') {
|
||||||
});
|
return next();
|
||||||
|
}
|
||||||
|
|
||||||
|
throw e;
|
||||||
|
}
|
||||||
|
|
||||||
|
res.render('confirm', {
|
||||||
|
title: '[[pages:confirm]]',
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user