Skip to content

Node.js based forum software built for the modern web

fix: closes #13317, fix email confirm for changing email

Barış Soner Uşaklı33d50637a338
diff --git a/public/language/en-GB/notifications.json b/public/language/en-GB/notifications.json
index f4d04ebe27..065cd6aeed 100644
--- a/public/language/en-GB/notifications.json
+++ b/public/language/en-GB/notifications.json
@@ -83,7 +83,6 @@
"email-confirmed": "Email Confirmed",
"email-confirmed-message": "Thank you for validating your email. Your account is now fully activated.",
"email-confirm-error-message": "There was a problem validating your email address. Perhaps the code was invalid or has expired.",
- "email-confirm-error-message-already-validated": "Your email address was already validated.",
"email-confirm-sent": "Confirmation email sent.",
"none": "None",
diff --git a/public/openapi/read/confirm/code.yaml b/public/openapi/read/confirm/code.yaml
index 9677cb1a66..9d55b016c1 100644
--- a/public/openapi/read/confirm/code.yaml
+++ b/public/openapi/read/confirm/code.yaml
@@ -24,9 +24,6 @@ get:
error:
type: string
description: Translation key for client-side localisation
- alreadyValidated:
- type: boolean
- description: set to true if the email was already validated
required:
- title
- $ref: ../../components/schemas/CommonProps.yaml#/CommonProps
\ No newline at end of file
diff --git a/src/controllers/index.js b/src/controllers/index.js
index f8152a6933..879774c17f 100644
--- a/src/controllers/index.js
+++ b/src/controllers/index.js
@@ -235,12 +235,6 @@ Controllers.confirmEmail = async (req, res) => {
return renderPage();
}
try {
- if (req.loggedIn) {
- const emailValidated = await user.getUserField(req.uid, 'email:confirmed');
- if (emailValidated) {
- return renderPage({ alreadyValidated: true });
- }
- }
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
diff --git a/src/views/confirm.tpl b/src/views/confirm.tpl
index 0235ced0d5..00396818b8 100644
--- a/src/views/confirm.tpl
+++ b/src/views/confirm.tpl
@@ -1,14 +1,9 @@
-{{{ if alreadyValidated }}}
-<div class="alert alert-info">
- <p>[[notifications:email-confirm-error-message-already-validated]]</p>
-{{{ end }}}
-
{{{ if error }}}
<div class="alert alert-warning">
<p>[[notifications:email-confirm-error-message]]</p>
{{{ end }}}
-{{{ if (!error && !alreadyValidated )}}}
+{{{ if !error }}}
<div class="alert alert-success">
<strong>[[notifications:email-confirmed]]</strong>
<p>[[notifications:email-confirmed-message]]</p>