Skip to content

fix #91 Display the error message and keep the email after a failed login - #92

Merged
njoubert-cleverage merged 1 commit into
mainfrom
91
Oct 5, 2026
Merged

njoubert-cleverage merged 1 commit into
mainfrom
91

Conversation

@njoubert-cleverage

Copy link
Copy Markdown
Member

Description

Fixes #91.

LoginController injects AuthenticationUtils and passes error (getLastAuthenticationError()) and last_username (getLastUsername()) to the login template, as expected by the EasyAdmin login template it extends. After a failed login, the page displays the error message (Invalid credentials.) and keeps the submitted email.

SecurityTest::testLoginWithAnInvalidPassword now follows the redirection and asserts the .alert-danger message and the #username value.

Checked:

  • bundle (Symfony 8.1, PHP 8.5): 329 tests OK; without the fix, testLoginWithAnInvalidPassword fails. PHPStan, PHP-CS-Fixer, Rector OK
  • process-bundle-demo (Symfony 7.4): Invalid credentials. displayed after an invalid password, email kept; a valid login still redirects to the UI

Requirements

  • Documentation updates
    • Reference
    • Changelog
  • Unit tests

Breaking changes

None.

🤖 Generated with Claude Code

…ame to the login template

The EasyAdmin login template displays the error with the `error` variable and fills the email with `last_username`:
after a failed login, no message was displayed and the email had to be typed again.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@njoubert-cleverage njoubert-cleverage added the bug Something isn't working label Oct 5, 2026
@njoubert-cleverage
njoubert-cleverage merged commit 477f9c2 into main Oct 5, 2026
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

No error message after a failed login, email not kept

1 participant