From 33d50637a33814f10bb5e8d78b8e314a39bea417 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Thu, 10 Apr 2025 09:53:20 -0400 Subject: [PATCH 1/5] fix: closes #13317, fix email confirm for changing email --- public/language/en-GB/notifications.json | 1 - public/openapi/read/confirm/code.yaml | 3 --- src/controllers/index.js | 6 ------ src/views/confirm.tpl | 7 +------ 4 files changed, 1 insertion(+), 16 deletions(-) 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 }}} -
-

[[notifications:email-confirm-error-message-already-validated]]

-{{{ end }}} - {{{ if error }}}

[[notifications:email-confirm-error-message]]

{{{ end }}} -{{{ if (!error && !alreadyValidated )}}} +{{{ if !error }}}
[[notifications:email-confirmed]]

[[notifications:email-confirmed-message]]

From 59bc2b0d4b4c1c10dca002f030404fd2fb47891e Mon Sep 17 00:00:00 2001 From: Misty Release Bot Date: Thu, 10 Apr 2025 14:03:46 +0000 Subject: [PATCH 2/5] chore: incrementing version number - v4.2.1 --- install/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install/package.json b/install/package.json index 24fdf6cd75..70159b0829 100644 --- a/install/package.json +++ b/install/package.json @@ -2,7 +2,7 @@ "name": "nodebb", "license": "GPL-3.0", "description": "NodeBB Forum", - "version": "4.2.0", + "version": "4.2.1", "homepage": "https://www.nodebb.org", "repository": { "type": "git", From 4cee37b98e5ded06f79ba8f80e9877808b51f29a Mon Sep 17 00:00:00 2001 From: Misty Release Bot Date: Thu, 10 Apr 2025 14:03:46 +0000 Subject: [PATCH 3/5] chore: update changelog for v4.2.1 --- CHANGELOG.md | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 33da12d0e3..ce6bf7959e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,34 @@ +#### v4.2.1 (2025-04-10) + +##### Chores + +* up harmony (d161eb6f) +* up persona (2237e17a) +* up persona (75f1f6fb) +* incrementing version number - v4.2.0 (87581958) +* update changelog for v4.2.0 (c9e0198d) +* incrementing version number - v4.1.1 (b2afbb16) +* incrementing version number - v4.1.0 (36c80850) +* incrementing version number - v4.0.6 (4a52fb2e) +* incrementing version number - v4.0.5 (1792a62b) +* incrementing version number - v4.0.4 (b1125cce) +* incrementing version number - v4.0.3 (2b65c735) +* incrementing version number - v4.0.2 (73fe5fcf) +* incrementing version number - v4.0.1 (a461b758) +* incrementing version number - v4.0.0 (c1eaee45) + +##### Bug Fixes + +* closes #13317, fix email confirm for changing email (33d50637) +* check if latestversion is valid before using semver.gt (6fe066ce) +* closes #13256, allow keyboard access to icon colors (c6620170) + +##### Refactors + +* get rid of async.parallel (e722e869) +* remove pointless true (747457d7) +* make register intro heading (c258f597) + #### v4.2.0 (2025-03-19) ##### Chores From 46ed56cf96bd979b6b5b45831136514a03e279f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Fri, 11 Apr 2025 19:51:18 -0400 Subject: [PATCH 4/5] refactor: use sortedSetsCard --- src/user/follow.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/user/follow.js b/src/user/follow.js index c89f90b979..9a497e6488 100644 --- a/src/user/follow.js +++ b/src/user/follow.js @@ -58,11 +58,8 @@ module.exports = function (User) { ]); } - const [followingCount, followingRemoteCount, followerCount, followerRemoteCount] = await Promise.all([ - db.sortedSetCard(`following:${uid}`), - db.sortedSetCard(`followingRemote:${uid}`), - db.sortedSetCard(`followers:${theiruid}`), - db.sortedSetCard(`followersRemote:${theiruid}`), + const [followingCount, followingRemoteCount, followerCount, followerRemoteCount] = await db.sortedSetsCard([ + `following:${uid}`, `followingRemote:${uid}`, `followers:${theiruid}`, `followersRemote:${theiruid}` ]); await Promise.all([ User.setUserField(uid, 'followingCount', followingCount + followingRemoteCount), From d59a5728dfc977f44533186ace531248c2917516 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Fri, 11 Apr 2025 19:58:48 -0400 Subject: [PATCH 5/5] lint: fix missing comma --- src/user/follow.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/user/follow.js b/src/user/follow.js index 9a497e6488..0595e50ff8 100644 --- a/src/user/follow.js +++ b/src/user/follow.js @@ -59,7 +59,7 @@ module.exports = function (User) { } const [followingCount, followingRemoteCount, followerCount, followerRemoteCount] = await db.sortedSetsCard([ - `following:${uid}`, `followingRemote:${uid}`, `followers:${theiruid}`, `followersRemote:${theiruid}` + `following:${uid}`, `followingRemote:${uid}`, `followers:${theiruid}`, `followersRemote:${theiruid}`, ]); await Promise.all([ User.setUserField(uid, 'followingCount', followingCount + followingRemoteCount),