refactor webOnInit

This commit is contained in:
rr-bw 2024-09-10 14:51:42 -07:00
parent 08261842e0
commit d76f4832e6
No known key found for this signature in database
GPG Key ID: 3FA13C3ADEE51D5D
1 changed files with 7 additions and 9 deletions

View File

@ -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;
}
}