1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-17 16:53:34 +00:00

PM-8111 - New Login Comp + Login Comp Svc - (1) Refactor naming and returns of getShowPasswordlessFlag to isLoginViaAuthRequestSupported (2) Replace showPasswordless with better composed variable names.

This commit is contained in:
Jared Snider
2024-09-30 15:30:31 -04:00
parent 79b2633d9e
commit d1a0c2f5f5
6 changed files with 13 additions and 17 deletions

View File

@@ -82,7 +82,7 @@ export class LoginComponent implements OnInit, OnDestroy {
ClientType = ClientType;
LoginUiState = LoginUiState;
registerRoute$ = this.registerRouteService.registerRoute$(); // TODO: remove when email verification flag is removed
showLoginWithDevice = false;
isKnownDevice = false;
validatedEmail = false;
formGroup = this.formBuilder.group(
@@ -112,7 +112,7 @@ export class LoginComponent implements OnInit, OnDestroy {
// Web properties
enforcedPasswordPolicyOptions: MasterPasswordPolicyOptions;
policies: Policy[];
showPasswordless = false;
loginViaAuthRequestSupported = false;
showResetPasswordAutoEnrollWarning = false;
// Desktop properties
@@ -144,7 +144,7 @@ export class LoginComponent implements OnInit, OnDestroy {
private extensionLoginService: ExtensionLoginService,
) {
this.clientType = this.platformUtilsService.getClientType();
this.showPasswordless = this.loginComponentService.getShowPasswordlessFlag();
this.loginViaAuthRequestSupported = this.loginComponentService.isLoginViaAuthRequestSupported();
}
async ngOnInit(): Promise<void> {
@@ -155,7 +155,7 @@ export class LoginComponent implements OnInit, OnDestroy {
await this.defaultOnInit();
if (this.clientType === ClientType.Browser) {
if (this.showPasswordless) {
if (this.loginViaAuthRequestSupported) {
await this.validateEmail();
}
}
@@ -423,12 +423,9 @@ export class LoginComponent implements OnInit, OnDestroy {
private async getLoginWithDevice(email: string): Promise<void> {
try {
const deviceIdentifier = await this.appIdService.getAppId();
this.showLoginWithDevice = await this.devicesApiService.getKnownDevice(
email,
deviceIdentifier,
);
this.isKnownDevice = await this.devicesApiService.getKnownDevice(email, deviceIdentifier);
} catch (e) {
this.showLoginWithDevice = false;
this.isKnownDevice = false;
}
}