Skip to content

Commit f4ea347

Browse files
Merge pull request #2330 from nextcloud/feat/neon_framework/bruteforce-thorttling-error-message
2 parents 050c12e + 73a91ae commit f4ea347

File tree

4 files changed

+15
-0
lines changed

4 files changed

+15
-0
lines changed

packages/neon_framework/lib/l10n/en.arb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
"loginMaintenanceModeDisabled": "Maintenance mode disabled",
3737
"loginCheckingAccount": "Checking account",
3838
"errorCredentialsForAccountNoLongerMatch": "The credentials for this account no longer match",
39+
"errorBruteforceThrottled": "Your requests are throttled at the moment due to brute force protection",
3940
"errorServerHadAProblemProcessingYourRequest": "The server had a problem while processing your request. You might want to try again",
4041
"errorSomethingWentWrongTryAgainLater": "Something went wrong. Please try again later",
4142
"errorUnableToReachServer": "Unable to reach the server",

packages/neon_framework/lib/l10n/localizations.dart

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,12 @@ abstract class NeonLocalizations {
191191
/// **'The credentials for this account no longer match'**
192192
String get errorCredentialsForAccountNoLongerMatch;
193193

194+
/// No description provided for @errorBruteforceThrottled.
195+
///
196+
/// In en, this message translates to:
197+
/// **'Your requests are throttled at the moment due to brute force protection'**
198+
String get errorBruteforceThrottled;
199+
194200
/// No description provided for @errorServerHadAProblemProcessingYourRequest.
195201
///
196202
/// In en, this message translates to:

packages/neon_framework/lib/l10n/localizations_en.dart

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,9 @@ class NeonLocalizationsEn extends NeonLocalizations {
7777
@override
7878
String get errorCredentialsForAccountNoLongerMatch => 'The credentials for this account no longer match';
7979

80+
@override
81+
String get errorBruteforceThrottled => 'Your requests are throttled at the moment due to brute force protection';
82+
8083
@override
8184
String get errorServerHadAProblemProcessingYourRequest =>
8285
'The server had a problem while processing your request. You might want to try again';

packages/neon_framework/lib/src/widgets/error.dart

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,11 @@ class NeonError extends StatelessWidget {
174174
isUnauthorized: true,
175175
);
176176
}
177+
if (error.statusCode == 429) {
178+
return NeonExceptionDetails(
179+
getText: (context) => NeonLocalizations.of(context).errorBruteforceThrottled,
180+
);
181+
}
177182
if (error.statusCode >= 500 && error.statusCode <= 599) {
178183
return NeonExceptionDetails(
179184
getText: (context) => NeonLocalizations.of(context).errorServerHadAProblemProcessingYourRequest,

0 commit comments

Comments
 (0)