diff --git a/libs/auth/src/angular/login/login.component.ts b/libs/auth/src/angular/login/login.component.ts index 25a374e6a20..11e6aaf5cfd 100644 --- a/libs/auth/src/angular/login/login.component.ts +++ b/libs/auth/src/angular/login/login.component.ts @@ -173,6 +173,8 @@ export class LoginComponentV2 implements OnInit, OnDestroy { private async handleAuthResult(authResult: AuthResult): Promise { 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 {