mirror of
https://github.com/bitwarden/browser
synced 2025-01-28 20:19:49 +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.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;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user