fix for resend, cooldown and a few small fixes

This commit is contained in:
Arseni
2026-02-13 01:03:47 +03:00
parent 44a22ce962
commit b5db65ef78
24 changed files with 550 additions and 227 deletions

View File

@@ -15,6 +15,7 @@ class ErrorHandler {
'account_not_verified': locs.errorAccountNotVerified,
'unauthorized': locs.errorLoginUnauthorized,
'verification_token_not_found': locs.errorVerificationTokenNotFound,
'user_already_registered': locs.errorDuplicateEmail,
'internal_error': locs.errorInternalError,
'invalid_target': locs.errorInvalidTarget,
'pending_token_required': locs.errorPendingTokenRequired,
@@ -62,6 +63,9 @@ class ErrorHandler {
}
static String _handleErrorResponseLocs(AppLocalizations locs, ErrorResponse e) {
if (e.source == 'user_already_registered') {
return locs.errorDuplicateEmail;
}
final errorMessages = getErrorMessagesLocs(locs);
// Return the localized message if we recognize the error key, else use the raw details
return errorMessages[e.error] ?? e.details;