mirror of
https://github.com/bitwarden/browser
synced 2025-12-13 14:53:33 +00:00
Ps 971/rate limiting error gives html (#3097)
* made changes in the errorResponse.ts to return toast message for status 429 * refactor the existing bug implementation Co-authored-by: dynwee <onwudiweokeke@gmail.com>
This commit is contained in:
@@ -21,15 +21,13 @@ export class ErrorResponse extends BaseResponse {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (errorModel) {
|
if (status === 429) {
|
||||||
|
this.message = "Rate limit exceeded. Try again later.";
|
||||||
|
} else if (errorModel) {
|
||||||
this.message = this.getResponseProperty("Message", errorModel);
|
this.message = this.getResponseProperty("Message", errorModel);
|
||||||
this.validationErrors = this.getResponseProperty("ValidationErrors", errorModel);
|
this.validationErrors = this.getResponseProperty("ValidationErrors", errorModel);
|
||||||
this.captchaSiteKey = this.validationErrors?.HCaptcha_SiteKey?.[0];
|
this.captchaSiteKey = this.validationErrors?.HCaptcha_SiteKey?.[0];
|
||||||
this.captchaRequired = !Utils.isNullOrWhitespace(this.captchaSiteKey);
|
this.captchaRequired = !Utils.isNullOrWhitespace(this.captchaSiteKey);
|
||||||
} else {
|
|
||||||
if (status === 429) {
|
|
||||||
this.message = "Rate limit exceeded. Try again later.";
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
this.statusCode = status;
|
this.statusCode = status;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user