mirror of
https://github.com/bitwarden/browser
synced 2025-12-23 11:43:46 +00:00
Update client for authService refactor (#2302)
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
import { Component } from "@angular/core";
|
||||
import { Router } from "@angular/router";
|
||||
|
||||
import { AuthService } from "jslib-common/abstractions/auth.service";
|
||||
import { I18nService } from "jslib-common/abstractions/i18n.service";
|
||||
import { PlatformUtilsService } from "jslib-common/abstractions/platformUtils.service";
|
||||
import { TwoFactorService } from "jslib-common/abstractions/twoFactor.service";
|
||||
|
||||
import { TwoFactorOptionsComponent as BaseTwoFactorOptionsComponent } from "jslib-angular/components/two-factor-options.component";
|
||||
|
||||
@@ -13,17 +13,17 @@ import { TwoFactorOptionsComponent as BaseTwoFactorOptionsComponent } from "jsli
|
||||
})
|
||||
export class TwoFactorOptionsComponent extends BaseTwoFactorOptionsComponent {
|
||||
constructor(
|
||||
authService: AuthService,
|
||||
twoFactorService: TwoFactorService,
|
||||
router: Router,
|
||||
i18nService: I18nService,
|
||||
platformUtilsService: PlatformUtilsService
|
||||
) {
|
||||
super(authService, router, i18nService, platformUtilsService, window);
|
||||
super(twoFactorService, router, i18nService, platformUtilsService, window);
|
||||
}
|
||||
|
||||
choose(p: any) {
|
||||
super.choose(p);
|
||||
this.authService.selectedTwoFactorProviderType = p.type;
|
||||
this.twoFactorService.setSelectedProvider(p.type);
|
||||
this.router.navigate(["2fa"]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@ import { MessagingService } from "jslib-common/abstractions/messaging.service";
|
||||
import { PlatformUtilsService } from "jslib-common/abstractions/platformUtils.service";
|
||||
import { StateService } from "jslib-common/abstractions/state.service";
|
||||
import { SyncService } from "jslib-common/abstractions/sync.service";
|
||||
import { TwoFactorService } from "jslib-common/abstractions/twoFactor.service";
|
||||
|
||||
import { TwoFactorComponent as BaseTwoFactorComponent } from "jslib-angular/components/two-factor.component";
|
||||
|
||||
@@ -43,7 +44,8 @@ export class TwoFactorComponent extends BaseTwoFactorComponent {
|
||||
stateService: StateService,
|
||||
route: ActivatedRoute,
|
||||
private messagingService: MessagingService,
|
||||
logService: LogService
|
||||
logService: LogService,
|
||||
twoFactorService: TwoFactorService
|
||||
) {
|
||||
super(
|
||||
authService,
|
||||
@@ -55,7 +57,8 @@ export class TwoFactorComponent extends BaseTwoFactorComponent {
|
||||
environmentService,
|
||||
stateService,
|
||||
route,
|
||||
logService
|
||||
logService,
|
||||
twoFactorService
|
||||
);
|
||||
super.onSuccessfulLogin = () => {
|
||||
return syncService.fullSync(true);
|
||||
|
||||
@@ -44,6 +44,7 @@ import { StorageService as StorageServiceAbstraction } from "jslib-common/abstra
|
||||
import { SyncService } from "jslib-common/abstractions/sync.service";
|
||||
import { TokenService } from "jslib-common/abstractions/token.service";
|
||||
import { TotpService } from "jslib-common/abstractions/totp.service";
|
||||
import { TwoFactorService } from "jslib-common/abstractions/twoFactor.service";
|
||||
import { UserVerificationService } from "jslib-common/abstractions/userVerification.service";
|
||||
import { VaultTimeoutService } from "jslib-common/abstractions/vaultTimeout.service";
|
||||
|
||||
@@ -147,6 +148,11 @@ export function initFactory(
|
||||
DebounceNavigationService,
|
||||
PopupUtilsService,
|
||||
{ provide: MessagingService, useClass: BrowserMessagingService },
|
||||
{
|
||||
provide: TwoFactorService,
|
||||
useFactory: getBgService<TwoFactorService>("twoFactorService"),
|
||||
deps: [],
|
||||
},
|
||||
{
|
||||
provide: AuthServiceAbstraction,
|
||||
useFactory: getBgService<AuthService>("authService"),
|
||||
|
||||
Reference in New Issue
Block a user