Skip to content

Commit

Permalink
Merge pull request #12080 from craftcms/bugfix/inactive-user-forgot-p…
Browse files Browse the repository at this point in the history
…assword

Fixed inactive user forgot password twice in a row
  • Loading branch information
brandonkelly authored Oct 10, 2022
2 parents e4b64cd + 63e1b5c commit f3fe85a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
- Fixed an error that could occur when adding new textual condition rules to a condition. ([#12077](https://github.com/craftcms/cms/pull/12077))
- Fixed a bug where Table fields’ Default Values settings were always showing at least one row, even if the setting had been saved without any rows. ([#12071](https://github.com/craftcms/cms/issues/12071))
- Fixed a bug where existing rows in Table fields’ Default Values settings were losing the ability to be reordered or deleted when the table columns were changed.
- Fixed a bug where sending a password reset email for an inactive user would set them to a pending state. ([#12080](https://github.com/craftcms/cms/pull/12080))

### Security
- Fixed information disclosure vulnerabilities.
Expand Down
3 changes: 2 additions & 1 deletion src/controllers/UsersController.php
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,8 @@ public function actionSendPasswordResetEmail(): ?Response
}
}

if (!empty($user) && !Craft::$app->getUsers()->sendPasswordResetEmail($user)) {
// Don't try to send the email if there are already error or there is no user
if (empty($errors) && !empty($user) && !Craft::$app->getUsers()->sendPasswordResetEmail($user)) {
$errors[] = Craft::t('app', 'There was a problem sending the password reset email.');
}

Expand Down

0 comments on commit f3fe85a

Please sign in to comment.