mirror of
https://github.com/bitwarden/browser
synced 2025-12-17 16:53:34 +00:00
move bow-row direct, and selected provider support
This commit is contained in:
@@ -63,6 +63,7 @@ export class AuthService {
|
||||
email: string;
|
||||
masterPasswordHash: string;
|
||||
twoFactorProviders: Map<TwoFactorProviderType, { [key: string]: string; }>;
|
||||
selectedTwoFactorProviderType: TwoFactorProviderType = null;
|
||||
|
||||
private key: SymmetricCryptoKey;
|
||||
|
||||
@@ -95,6 +96,7 @@ export class AuthService {
|
||||
}
|
||||
|
||||
async logIn(email: string, masterPassword: string): Promise<AuthResult> {
|
||||
this.selectedTwoFactorProviderType = null;
|
||||
email = email.toLowerCase();
|
||||
const key = this.cryptoService.makeKey(masterPassword, email);
|
||||
const hashedPassword = await this.cryptoService.hashPassword(masterPassword, key);
|
||||
@@ -117,6 +119,11 @@ export class AuthService {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (this.selectedTwoFactorProviderType != null &&
|
||||
this.twoFactorProviders.has(this.selectedTwoFactorProviderType)) {
|
||||
return this.selectedTwoFactorProviderType;
|
||||
}
|
||||
|
||||
let providerType: TwoFactorProviderType = null;
|
||||
let providerPriority = -1;
|
||||
this.twoFactorProviders.forEach((value, type) => {
|
||||
@@ -188,5 +195,6 @@ export class AuthService {
|
||||
this.email = null;
|
||||
this.masterPasswordHash = null;
|
||||
this.twoFactorProviders = null;
|
||||
this.selectedTwoFactorProviderType = null;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user