mirror of
https://github.com/bitwarden/browser.git
synced 2024-12-22 16:29:09 +01: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:
parent
cadba40109
commit
01dd22fda8
@ -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.validationErrors = this.getResponseProperty("ValidationErrors", errorModel);
|
||||
this.captchaSiteKey = this.validationErrors?.HCaptcha_SiteKey?.[0];
|
||||
this.captchaRequired = !Utils.isNullOrWhitespace(this.captchaSiteKey);
|
||||
} else {
|
||||
if (status === 429) {
|
||||
this.message = "Rate limit exceeded. Try again later.";
|
||||
}
|
||||
}
|
||||
this.statusCode = status;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user