fix(web): show specific authentication error messages

Merged
BR
2mo ago
+54-39

Fixes SOU-2271

Authentication failures such as provider callback errors and failed security checks previously displayed a generic message on the login form. The login form and standalone error page now share messages with recovery guidance for OAuthCallbackError, MissingCSRF, AccountNotLinked, and WebAuthnVerificationError, alongside the existing error messages.

Unknown or missing codes use a shared generic fallback. Authentication behavior and redirects are unchanged.

Validation: ESLint passed for all three changed files, and all three existing login-form tests passed.


[!NOTE]
Low Risk
Presentation-only change to login and error-page copy; authentication flows and redirects are unchanged.

Overview
Centralizes authentication failure copy in a new shared getAuthErrorContent helper so the login form and standalone auth error page show the same titles and recovery guidance instead of maintaining separate, partial message maps.

The login form no longer maps only a few error codes inline; it now surfaces specific messages for provider callback failures, CSRF checks, unlinked accounts, and passkey verification, alongside existing cases like invalid credentials and OAuth account conflicts. Unknown or missing codes still fall back to a generic message.

Reviewed by Cursor Bugbot for commit 5a153270f7f7d28c3d548de629d8a926464f0e0d. Bugbot is set up for automated code reviews on this repo. Configure here.


Summary by cubic

Fixes SOU-2271 so authentication failures show specific error messages with recovery guidance instead of a generic message on the login form and standalone error page.

  • Adds a shared error message module used by both the login form and error page.
  • Covers OAuthCallbackError, MissingCSRF, AccountNotLinked, and WebAuthnVerificationError in addition to existing messages.
  • Unknown or missing error codes fall back to a generic message.
  • Authentication behavior and redirects are unchanged.

Summary by CodeRabbit

  • Bug Fixes
    • Standardized authentication error titles, descriptions, and recovery guidance across the login form and error page.
    • Improved fallback handling for missing or unrecognized authentication errors.