handle browser ngOnInit

This commit is contained in:
rr-bw 2024-09-09 13:19:02 -07:00
parent 3c68fb0876
commit 81a623d998
No known key found for this signature in database
GPG Key ID: 3FA13C3ADEE51D5D
2 changed files with 13 additions and 1 deletions

View File

@ -1,3 +1,9 @@
import { DefaultLoginService, LoginService } from "@bitwarden/auth/angular";
export class ExtensionLoginService extends DefaultLoginService implements LoginService {}
import { flagEnabled } from "../../../platform/flags"; // TODO-rr-bw: do I need a client specific `flagEnabled()` fn?
export class ExtensionLoginService extends DefaultLoginService implements LoginService {
getShowPasswordlessFlag(): boolean {
return flagEnabled("showPasswordless");
}
}

View File

@ -127,6 +127,12 @@ export class LoginComponentV2 implements OnInit, OnDestroy {
this.showResetPasswordAutoEnrollWarning = orgPolicies?.isPolicyAndAutoEnrollEnabled;
this.enforcedPasswordPolicyOptions = orgPolicies?.enforcedPasswordPolicyOptions;
}
if (this.clientType === ClientType.Browser) {
if (this.showPasswordless) {
await this.validateEmail();
}
}
}
ngOnDestroy(): void {