diff --git a/packages/neon_framework/lib/l10n/en.arb b/packages/neon_framework/lib/l10n/en.arb index b44eb6b648b..4cdc22f24f7 100644 --- a/packages/neon_framework/lib/l10n/en.arb +++ b/packages/neon_framework/lib/l10n/en.arb @@ -36,6 +36,7 @@ "loginMaintenanceModeDisabled": "Maintenance mode disabled", "loginCheckingAccount": "Checking account", "errorCredentialsForAccountNoLongerMatch": "The credentials for this account no longer match", + "errorBruteforceThrottled": "Your requests are throttled at the moment due to brute force protection", "errorServerHadAProblemProcessingYourRequest": "The server had a problem while processing your request. You might want to try again", "errorSomethingWentWrongTryAgainLater": "Something went wrong. Please try again later", "errorUnableToReachServer": "Unable to reach the server", diff --git a/packages/neon_framework/lib/l10n/localizations.dart b/packages/neon_framework/lib/l10n/localizations.dart index 6a034f5790a..e6d35f53533 100644 --- a/packages/neon_framework/lib/l10n/localizations.dart +++ b/packages/neon_framework/lib/l10n/localizations.dart @@ -191,6 +191,12 @@ abstract class NeonLocalizations { /// **'The credentials for this account no longer match'** String get errorCredentialsForAccountNoLongerMatch; + /// No description provided for @errorBruteforceThrottled. + /// + /// In en, this message translates to: + /// **'Your requests are throttled at the moment due to brute force protection'** + String get errorBruteforceThrottled; + /// No description provided for @errorServerHadAProblemProcessingYourRequest. /// /// In en, this message translates to: diff --git a/packages/neon_framework/lib/l10n/localizations_en.dart b/packages/neon_framework/lib/l10n/localizations_en.dart index 0dbbb961d1a..095105424c5 100644 --- a/packages/neon_framework/lib/l10n/localizations_en.dart +++ b/packages/neon_framework/lib/l10n/localizations_en.dart @@ -77,6 +77,9 @@ class NeonLocalizationsEn extends NeonLocalizations { @override String get errorCredentialsForAccountNoLongerMatch => 'The credentials for this account no longer match'; + @override + String get errorBruteforceThrottled => 'Your requests are throttled at the moment due to brute force protection'; + @override String get errorServerHadAProblemProcessingYourRequest => 'The server had a problem while processing your request. You might want to try again'; diff --git a/packages/neon_framework/lib/src/widgets/error.dart b/packages/neon_framework/lib/src/widgets/error.dart index c78b0df36e4..ac42d08ad5b 100644 --- a/packages/neon_framework/lib/src/widgets/error.dart +++ b/packages/neon_framework/lib/src/widgets/error.dart @@ -174,6 +174,11 @@ class NeonError extends StatelessWidget { isUnauthorized: true, ); } + if (error.statusCode == 429) { + return NeonExceptionDetails( + getText: (context) => NeonLocalizations.of(context).errorBruteforceThrottled, + ); + } if (error.statusCode >= 500 && error.statusCode <= 599) { return NeonExceptionDetails( getText: (context) => NeonLocalizations.of(context).errorServerHadAProblemProcessingYourRequest,