1
0
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:
Kyle Spearrin
2018-04-04 14:18:42 -04:00
parent f855a8272c
commit f673bd62d7
3 changed files with 58 additions and 0 deletions

View File

@@ -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;
}
}