fix(auth): polish login/register/reset pages for consistency and accessibility
- LoginPage: add client-side email/password validation (inline error + helperText, matching the 2FA components' established pattern), and a proper register-mode toggle with a "Confirm password" field. The brief asked for confirm-password on registration but the page only had one shared password field; a toggle (mirroring the existing Tabs-for-mode pattern already used for Google/Microsoft) keeps this from cluttering the login form for returning users. - Fix a real bug in ResetPasswordPage: it didn't use the app's getApiErrorMessage helper, so a non-string error response body would render as "[object Object]" in the toast. Also add a confirm-password field and matching client-side validation for parity with register. - ForgotPasswordPage: add proper email format validation instead of only checking for non-empty. - Add matching i18n keys (en/no) for every new validation message. Verified live end-to-end against a running backend: register-mode toggle, confirm-password mismatch blocking submission client-side, and a full registration completing and landing on the dashboard.
This commit is contained in:
@@ -768,6 +768,12 @@ export const translations = {
|
||||
passwordResetRequestSent: "If that account exists, a reset link has been sent.",
|
||||
passwordResetRequestFailed: "Could not send the reset link.",
|
||||
loginFailed: "Login failed.",
|
||||
emailRequired: "Enter your email address.",
|
||||
invalidEmail: "Enter a valid email address.",
|
||||
passwordRequired: "Enter your password.",
|
||||
passwordTooShort: "Password must be at least 8 characters, with a number and a lowercase letter.",
|
||||
confirmPassword: "Confirm password",
|
||||
passwordsDoNotMatch: "Passwords do not match.",
|
||||
resetPasswordTitle: "Reset password",
|
||||
resetPasswordBody: "Set a new password for your account.",
|
||||
missingResetLinkInfo: "Missing email/token in link.",
|
||||
@@ -1816,6 +1822,12 @@ export const translations = {
|
||||
passwordResetRequestSent: "Hvis kontoen finnes, er en nullstillingslenke sendt.",
|
||||
passwordResetRequestFailed: "Kunne ikke sende nullstillingslenken.",
|
||||
loginFailed: "Innlogging mislyktes.",
|
||||
emailRequired: "Skriv inn e-postadressen din.",
|
||||
invalidEmail: "Skriv inn en gyldig e-postadresse.",
|
||||
passwordRequired: "Skriv inn passordet ditt.",
|
||||
passwordTooShort: "Passordet må være minst 8 tegn, med et tall og en liten bokstav.",
|
||||
confirmPassword: "Bekreft passord",
|
||||
passwordsDoNotMatch: "Passordene stemmer ikke overens.",
|
||||
resetPasswordTitle: "Tilbakestill passord",
|
||||
resetPasswordBody: "Sett et nytt passord for kontoen din.",
|
||||
missingResetLinkInfo: "Mangler e-post/token i lenken.",
|
||||
|
||||
Reference in New Issue
Block a user