mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-08-26 23:35:16 +02:00
fix: #11589, regression where a user could not confirm their email if requireEmailAddress was enabled
This commit is contained in:
@@ -222,6 +222,14 @@ Controllers.registerInterstitial = async function (req, res, next) {
|
||||
Controllers.confirmEmail = async (req, res, next) => {
|
||||
try {
|
||||
await user.email.confirmByCode(req.params.code, req.session.id);
|
||||
if (req.session.registration) {
|
||||
// After confirmation, no need to send user back to email change form
|
||||
delete req.session.registration.updateEmail;
|
||||
}
|
||||
|
||||
res.render('confirm', {
|
||||
title: '[[pages:confirm]]',
|
||||
});
|
||||
} catch (e) {
|
||||
if (e.message === '[[error:invalid-data]]') {
|
||||
return next();
|
||||
@@ -229,10 +237,6 @@ Controllers.confirmEmail = async (req, res, next) => {
|
||||
|
||||
throw e;
|
||||
}
|
||||
|
||||
res.render('confirm', {
|
||||
title: '[[pages:confirm]]',
|
||||
});
|
||||
};
|
||||
|
||||
Controllers.robots = function (req, res) {
|
||||
|
||||
Reference in New Issue
Block a user