1
0
mirror of https://github.com/bitwarden/browser.git synced 2025-01-22 21:21:35 +01:00

refactor handlCaptchaRequired()

This commit is contained in:
rr-bw 2024-09-10 15:15:56 -07:00
parent ff53feeed5
commit b64552f183
No known key found for this signature in database
GPG Key ID: 3FA13C3ADEE51D5D

View File

@ -173,6 +173,8 @@ export class LoginComponentV2 implements OnInit, OnDestroy {
private async handleAuthResult(authResult: AuthResult): Promise<void> {
if (this.handleCaptchaRequired(authResult)) {
this.captchaSiteKey = authResult.captchaSiteKey;
this.captcha.init(authResult.captchaSiteKey);
return;
}
@ -364,13 +366,7 @@ export class LoginComponentV2 implements OnInit, OnDestroy {
}
private handleCaptchaRequired(authResult: AuthResult): boolean {
if (Utils.isNullOrWhitespace(authResult.captchaSiteKey)) {
return false;
}
this.captchaSiteKey = authResult.captchaSiteKey;
this.captcha.init(authResult.captchaSiteKey);
return true;
return !Utils.isNullOrWhitespace(authResult.captchaSiteKey);
}
private async loadEmailSettings(): Promise<void> {