feat(web): improve login error messages and add forgot password flow#931
Conversation
- Map Firebase error codes to user-friendly messages from Firebase UI translations (e.g. 'Incorrect password' instead of raw error strings) - Add field-level error display using :error and :error-messages on v-text-field components so invalid fields turn red - Add client-side validation for empty/invalid email and empty password - Implement inline forgot password flow with email input, reset link submission via sendPasswordResetEmail, and success confirmation Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
PR Summary
|
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 28 |
| Duplication | 0 |
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
| case 'auth/wrong-password': | ||
| case 'auth/invalid-credential': | ||
| errorMessages.value.add('password', 'Incorrect password') | ||
| break |
There was a problem hiding this comment.
auth/invalid-credential misleadingly shown as a password error. Modern Firebase Auth (with email enumeration protection enabled) returns auth/invalid-credential for both a non-existent email address and a wrong password. Placing that error exclusively on the password field ("Incorrect password") tells a user who simply mistyped their email address that their password is wrong — sending them in the wrong direction. The original wording "Invalid email or password" surfaced as a general message was intentionally ambiguous for this reason.
| case 'auth/wrong-password': | |
| case 'auth/invalid-credential': | |
| errorMessages.value.add('password', 'Incorrect password') | |
| break | |
| case 'auth/wrong-password': | |
| errorMessages.value.add('password', 'Incorrect password') | |
| break | |
| case 'auth/invalid-credential': | |
| generalError.value = 'Invalid email or password' | |
| break |
- Map auth/invalid-credential to both email and password fields since modern Firebase returns this code for either wrong email or password - Trim email before passing to Firebase in submitEmail to match the pattern already used in submitPasswordReset Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Summary
Improves the login experience by replacing raw Firebase error strings with user-friendly messages and adding a forgot password flow.
Changes
Error Message Improvements
:errorand:error-messagesonv-text-fieldcomponents (fields turn red with specific messages)Forgot Password Flow