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

[authService refactor] Fix browser by not using instanceof (#647)

* use authenticationType enum instead of instanceof
This commit is contained in:
Thomas Rittson
2022-02-07 07:33:19 +10:00
committed by GitHub
parent 380a7c7ee5
commit 9caea70ea2
3 changed files with 20 additions and 7 deletions

View File

@@ -1,6 +1,10 @@
import { AuthenticationType } from "../../enums/authenticationType";
import { TokenRequestTwoFactor } from "../request/identityToken/tokenRequest";
export class PasswordLogInCredentials {
readonly type = AuthenticationType.Password;
constructor(
public email: string,
public masterPassword: string,
@@ -10,6 +14,8 @@ export class PasswordLogInCredentials {
}
export class SsoLogInCredentials {
readonly type = AuthenticationType.Sso;
constructor(
public code: string,
public codeVerifier: string,
@@ -20,5 +26,7 @@ export class SsoLogInCredentials {
}
export class ApiLogInCredentials {
readonly type = AuthenticationType.Api;
constructor(public clientId: string, public clientSecret: string) {}
}