1
0
mirror of https://github.com/bitwarden/jslib synced 2025-12-19 09:43:28 +00:00

Update twoFactorService interface

This commit is contained in:
Thomas Rittson
2021-12-21 11:27:14 +10:00
parent df14a0ec0e
commit 84e060e493
3 changed files with 11 additions and 5 deletions

View File

@@ -67,7 +67,7 @@ export class TwoFactorComponent implements OnInit, OnDestroy {
}
async ngOnInit() {
if (!this.authing || this.twoFactorService.providers == null) {
if (!this.authing || this.twoFactorService.getProviders() == null) {
this.router.navigate([this.loginRoute]);
return;
}
@@ -122,7 +122,7 @@ export class TwoFactorComponent implements OnInit, OnDestroy {
this.cleanupWebAuthn();
this.title = (TwoFactorProviders as any)[this.selectedProviderType].name;
const providerData = this.twoFactorService.providers.get(this.selectedProviderType);
const providerData = this.twoFactorService.getProviders().get(this.selectedProviderType);
switch (this.selectedProviderType) {
case TwoFactorProviderType.WebAuthn:
if (!this.webAuthnNewTab) {
@@ -150,7 +150,7 @@ export class TwoFactorComponent implements OnInit, OnDestroy {
break;
case TwoFactorProviderType.Email:
this.twoFactorEmail = providerData.Email;
if (this.twoFactorService.providers.size > 1) {
if (this.twoFactorService.getProviders().size > 1) {
await this.sendEmail(false);
}
break;
@@ -250,7 +250,7 @@ export class TwoFactorComponent implements OnInit, OnDestroy {
}
authWebAuthn() {
const providerData = this.twoFactorService.providers.get(this.selectedProviderType);
const providerData = this.twoFactorService.getProviders().get(this.selectedProviderType);
if (!this.webAuthnSupported || this.webAuthn == null) {
return;