From d76f4832e6e4d3ec37acab51675cf51193cdd872 Mon Sep 17 00:00:00 2001 From: rr-bw <102181210+rr-bw@users.noreply.github.com> Date: Tue, 10 Sep 2024 14:51:42 -0700 Subject: [PATCH] refactor webOnInit --- libs/auth/src/angular/login/login.component.ts | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/libs/auth/src/angular/login/login.component.ts b/libs/auth/src/angular/login/login.component.ts index d025e7f156..c712a85a6a 100644 --- a/libs/auth/src/angular/login/login.component.ts +++ b/libs/auth/src/angular/login/login.component.ts @@ -121,15 +121,6 @@ export class LoginComponentV2 implements OnInit, OnDestroy { await this.defaultOnInit(); - if (this.clientType === ClientType.Web) { - // If there's an existing org invite, use it to get the password policies - const orgPolicies = await this.loginService.getOrgPolicies(); - - this.policies = orgPolicies?.policies; - this.showResetPasswordAutoEnrollWarning = orgPolicies?.isPolicyAndAutoEnrollEnabled; - this.enforcedPasswordPolicyOptions = orgPolicies?.enforcedPasswordPolicyOptions; - } - if (this.clientType === ClientType.Browser) { if (this.showPasswordless) { await this.validateEmail(); @@ -455,5 +446,12 @@ export class LoginComponentV2 implements OnInit, OnDestroy { this.loginService.setPreviousUrl(route); } }); + + // If there's an existing org invite, use it to get the password policies + const orgPolicies = await this.loginService.getOrgPolicies(); + + this.policies = orgPolicies?.policies; + this.showResetPasswordAutoEnrollWarning = orgPolicies?.isPolicyAndAutoEnrollEnabled; + this.enforcedPasswordPolicyOptions = orgPolicies?.enforcedPasswordPolicyOptions; } }