1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-16 08:13:42 +00:00

Add isLoginWithPasskeySupported function to reduce client type checking in template.

This commit is contained in:
Alec Rippberger
2024-10-01 13:02:39 -05:00
parent a104a9250d
commit ca0520cea0
4 changed files with 18 additions and 2 deletions

View File

@@ -3,6 +3,7 @@ import { firstValueFrom } from "rxjs";
import { LoginComponentService, PasswordPolicies } from "@bitwarden/auth/angular";
import { SsoLoginServiceAbstraction } from "@bitwarden/common/auth/abstractions/sso-login.service.abstraction";
import { ClientType } from "@bitwarden/common/enums";
import { CryptoFunctionService } from "@bitwarden/common/platform/abstractions/crypto-function.service";
import { EnvironmentService } from "@bitwarden/common/platform/abstractions/environment.service";
import { PlatformUtilsService } from "@bitwarden/common/platform/abstractions/platform-utils.service";
@@ -10,6 +11,8 @@ import { Utils } from "@bitwarden/common/platform/misc/utils";
import { PasswordGenerationServiceAbstraction } from "@bitwarden/generator-legacy";
export class DefaultLoginComponentService implements LoginComponentService {
protected clientType: ClientType;
constructor(
protected cryptoFunctionService: CryptoFunctionService,
protected environmentService: EnvironmentService,
@@ -31,6 +34,10 @@ export class DefaultLoginComponentService implements LoginComponentService {
return false;
}
isLoginWithPasskeySupported(): boolean {
return this.clientType == ClientType.Web;
}
async launchSsoBrowserWindow(
email: string,
clientId: "browser" | "desktop",