Skip to content

Storefront sign-in and password recovery: answer the same whether or not an address has an account - #1114

Merged
KrzysztofPajak merged 1 commit into
developfrom
fix/login-messages-no-account-hint
Nov 23, 2026
Merged

KrzysztofPajak merged 1 commit into
developfrom
fix/login-messages-no-account-hint

Conversation

@KrzysztofPajak

@KrzysztofPajak KrzysztofPajak commented Nov 23, 2026 •

Copy link
Copy Markdown
Member

The storefront told a visitor which e-mail addresses have an account, before any password was checked:

  • the sign-in form answered "No customer account found", "Customer is deleted", "Account is not active" or "Account is not registered";
  • password recovery answered "Email not found.", "Account is deleted", "Account is not active" or "Account is locked out";
  • the recovery link page sent an unknown address to the home page and showed the account's page for a known one, and its form posted back the same distinct messages without a valid token.

The panels already answer recovery the same way for every address (PanelPasswordRecoveryService); the storefront now does too.

Changes

  • LoginValidator (storefront): an unknown, deleted or not registered account gets the wrong-password message. Whether the account is active is told only after the right password; a wrong password on an inactive account now counts as a failed sign-in too. A locked-out account still gets the locked-out message, before the password is checked, so the lockout cannot be used to test passwords.
  • PasswordRecoveryValidator checks the address and the captcha only. PasswordRecoverySendCommandHandler sends no message, and stores no token, for an account that is deleted, inactive, locked out, not registered, or signs in only through the identity provider; the page says "email has been sent" in every case.
  • PasswordRecoveryConfirmValidator: an unknown address, or an account in any of those states, reads as a wrong link, as in the panels.
  • The recovery link page (GET) shows the wrong-link message for an unknown address instead of redirecting home.

Notes

  • A customer whose account is inactive or locked out no longer gets a recovery e-mail; the page does not say why. This is how the panels behave.
  • The resources the storefront no longer shows (Account.Login.WrongCredentials.CustomerNotExist, .Deleted, .NotRegistered, Account.PasswordRecovery.EmailNotFound, .Deleted, .NotActive, .LockedOut, .NotRegistered) stay in the language files.
  • The response time still differs a little between an unknown address and a wrong password (no password hash is computed for an unknown one).

Tests

  • LoginValidatorAccountStateTests (new): unknown, deleted and not registered accounts get the wrong-password message; an inactive account with a wrong password gets it and is counted; with the right password it gets "not active".
  • PasswordRecoverySendCommandHandlerTests: no message for an inactive, deleted, locked-out or not registered account.
  • PasswordRecoveryConfirmValidatorExternalSignInTests: an unknown address and an inactive account read as a wrong link.
  • The store-scoping test of PasswordRecoveryValidator is removed: it no longer looks the account up; the controller's lookup still passes the store.
  • Grand.Web.Tests (665) pass.

Copilot AI balanced review requested due to automatic review settings November 23, 2026 17:51

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@KrzysztofPajak
KrzysztofPajak merged commit 10a4b6d into develop Nov 23, 2026
9 checks passed
@KrzysztofPajak
KrzysztofPajak deleted the fix/login-messages-no-account-hint branch November 25, 2026 09:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants