refactor(signup): type API errors with status-code-based enum
Introduce LegacySignupErrorEvent to map backend failures from POST /auth/signup: 400 → emailAlreadyExists, 403 → invalidField, 429 → tooManyAttempts, timeout → network. The view state now separates validationErrorKey (pre-submit i18n keys) from apiErrorEvent (typed API outcomes), and the screen listens to both to show proper i18n messages instead of leaking raw backend text.
This commit is contained in:
@@ -83,6 +83,7 @@
|
||||
"authErrorInvalidToken": "Ihre Sitzung ist abgelaufen. Bitte melden Sie sich erneut an.",
|
||||
"authErrorTooManyAttempts": "Zu viele Versuche. Bitte warten Sie einige Minuten und versuchen Sie es erneut.",
|
||||
"authErrorNetwork": "Keine Verbindung. Überprüfen Sie Ihr Netzwerk und versuchen Sie es erneut.",
|
||||
"signupErrorInvalidField": "Eines der Felder ist ungültig. Bitte überprüfen Sie es und versuchen Sie es erneut.",
|
||||
"stepUserContactSupertitle": "Benutzer und Kontakt",
|
||||
"stepUserContactTitle": "Erstelle dein Konto",
|
||||
"stepUserContactSubtitle": "Mit deiner E-Mail und deiner Telefonnummer können wir dich jederzeit informieren",
|
||||
|
||||
@@ -83,6 +83,7 @@
|
||||
"authErrorInvalidToken": "Your session has expired. Please log in again.",
|
||||
"authErrorTooManyAttempts": "Too many attempts. Please wait a few minutes and try again.",
|
||||
"authErrorNetwork": "No connection. Check your network and try again.",
|
||||
"signupErrorInvalidField": "One of the fields is invalid. Please check and try again.",
|
||||
"stepUserContactSupertitle": "User & contact",
|
||||
"stepUserContactTitle": "Create your account",
|
||||
"stepUserContactSubtitle": "With your email and phone number we can keep you informed at all times",
|
||||
|
||||
@@ -83,6 +83,7 @@
|
||||
"authErrorInvalidToken": "La sesión ha caducado. Vuelve a iniciar sesión.",
|
||||
"authErrorTooManyAttempts": "Demasiados intentos. Espera unos minutos e inténtalo de nuevo.",
|
||||
"authErrorNetwork": "No hay conexión. Comprueba tu red e inténtalo de nuevo.",
|
||||
"signupErrorInvalidField": "Alguno de los campos no es válido. Revísalos e inténtalo de nuevo.",
|
||||
"stepUserContactSupertitle": "Usuario y contacto",
|
||||
"stepUserContactTitle": "Crea tu usuario",
|
||||
"stepUserContactSubtitle": "Con tu email y tu número podremos mantenerte siempre informado",
|
||||
|
||||
@@ -83,6 +83,7 @@
|
||||
"authErrorInvalidToken": "Votre session a expiré. Veuillez vous reconnecter.",
|
||||
"authErrorTooManyAttempts": "Trop de tentatives. Patientez quelques minutes avant de réessayer.",
|
||||
"authErrorNetwork": "Pas de connexion. Vérifiez votre réseau et réessayez.",
|
||||
"signupErrorInvalidField": "L'un des champs n'est pas valide. Vérifiez et réessayez.",
|
||||
"stepUserContactSupertitle": "Utilisateur et contact",
|
||||
"stepUserContactTitle": "Crée ton compte",
|
||||
"stepUserContactSubtitle": "Avec ton e-mail et ton numéro, nous pourrons te tenir informé à tout moment",
|
||||
|
||||
@@ -83,6 +83,7 @@
|
||||
"authErrorInvalidToken": "La tua sessione è scaduta. Accedi di nuovo.",
|
||||
"authErrorTooManyAttempts": "Troppi tentativi. Attendi qualche minuto e riprova.",
|
||||
"authErrorNetwork": "Nessuna connessione. Controlla la tua rete e riprova.",
|
||||
"signupErrorInvalidField": "Uno dei campi non è valido. Controlla e riprova.",
|
||||
"stepUserContactSupertitle": "Utente e contatti",
|
||||
"stepUserContactTitle": "Crea il tuo account",
|
||||
"stepUserContactSubtitle": "Con la tua email e il tuo numero potremo tenerti sempre informato",
|
||||
|
||||
@@ -83,6 +83,7 @@
|
||||
"authErrorInvalidToken": "A tua sessão expirou. Volta a iniciar sessão.",
|
||||
"authErrorTooManyAttempts": "Demasiadas tentativas. Aguarda alguns minutos e tenta novamente.",
|
||||
"authErrorNetwork": "Sem ligação. Verifica a tua rede e tenta novamente.",
|
||||
"signupErrorInvalidField": "Um dos campos não é válido. Verifica e tenta novamente.",
|
||||
"stepUserContactSupertitle": "Utilizador e contacto",
|
||||
"stepUserContactTitle": "Cria a tua conta",
|
||||
"stepUserContactSubtitle": "Com o teu email e o teu número poderemos manter-te sempre informado",
|
||||
|
||||
@@ -423,6 +423,7 @@ class I18n {
|
||||
static const String authErrorInvalidToken = 'authErrorInvalidToken';
|
||||
static const String authErrorTooManyAttempts = 'authErrorTooManyAttempts';
|
||||
static const String authErrorNetwork = 'authErrorNetwork';
|
||||
static const String signupErrorInvalidField = 'signupErrorInvalidField';
|
||||
static const String errorGeofenceCreate = 'errorGeofenceCreate';
|
||||
static const String errorGeofenceDelete = 'errorGeofenceDelete';
|
||||
static const String errorGeofenceUpdate = 'errorGeofenceUpdate';
|
||||
|
||||
Reference in New Issue
Block a user