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

email 2fa setup

This commit is contained in:
Kyle Spearrin
2018-06-27 16:56:11 -04:00
parent a097793b0d
commit 890bf49294
5 changed files with 221 additions and 0 deletions

View File

@@ -18,6 +18,7 @@ import { ModalComponent } from '../modal.component';
import { TwoFactorAuthenticatorComponent } from './two-factor-authenticator.component';
import { TwoFactorDuoComponent } from './two-factor-duo.component';
import { TwoFactorEmailComponent } from './two-factor-email.component';
import { TwoFactorYubiKeyComponent } from './two-factor-yubikey.component';
@Component({
@@ -30,6 +31,7 @@ export class TwoFactorSetupComponent implements OnInit {
@ViewChild('yubikeyTemplate', { read: ViewContainerRef }) yubikeyModalRef: ViewContainerRef;
@ViewChild('u2fTemplate', { read: ViewContainerRef }) u2fModalRef: ViewContainerRef;
@ViewChild('duoTemplate', { read: ViewContainerRef }) duoModalRef: ViewContainerRef;
@ViewChild('emailTemplate', { read: ViewContainerRef }) emailModalRef: ViewContainerRef;
providers: any[] = [];
premium: boolean;
@@ -100,6 +102,12 @@ export class TwoFactorSetupComponent implements OnInit {
this.updateStatus(enabled, TwoFactorProviderType.Duo);
});
break;
case TwoFactorProviderType.Email:
const emailComp = this.openModal(this.emailModalRef, TwoFactorEmailComponent);
emailComp.onUpdated.subscribe((enabled: boolean) => {
this.updateStatus(enabled, TwoFactorProviderType.Email);
});
break;
default:
break;
}