mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-01-06 23:52:58 +01:00
Merge branch 'master' into develop
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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),
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user