From 762e3f8198f0c667d075060554c9548a23c8d4f7 Mon Sep 17 00:00:00 2001 From: Thomas Rittson <31796059+eliykat@users.noreply.github.com> Date: Tue, 8 Feb 2022 09:26:53 +1000 Subject: [PATCH] Update client for authService refactor (#1239) --- jslib | 2 +- src/app/accounts/two-factor-options.component.ts | 6 +++--- src/app/accounts/two-factor.component.ts | 7 +++++-- src/app/services.module.ts | 9 ++++----- 4 files changed, 13 insertions(+), 11 deletions(-) diff --git a/jslib b/jslib index e0cc754d6f..6b8508579f 160000 --- a/jslib +++ b/jslib @@ -1 +1 @@ -Subproject commit e0cc754d6fe962a5e7eae6d1dead8b44606d4853 +Subproject commit 6b8508579f89b4c54afa6aab2b7155aac70fb8a9 diff --git a/src/app/accounts/two-factor-options.component.ts b/src/app/accounts/two-factor-options.component.ts index 599845e994..5306064381 100644 --- a/src/app/accounts/two-factor-options.component.ts +++ b/src/app/accounts/two-factor-options.component.ts @@ -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,11 +13,11 @@ 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); } } diff --git a/src/app/accounts/two-factor.component.ts b/src/app/accounts/two-factor.component.ts index 1b4a4cff80..a8d36cbe2c 100644 --- a/src/app/accounts/two-factor.component.ts +++ b/src/app/accounts/two-factor.component.ts @@ -14,6 +14,7 @@ import { LogService } from "jslib-common/abstractions/log.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 { ModalService } from "jslib-angular/services/modal.service"; @@ -40,7 +41,8 @@ export class TwoFactorComponent extends BaseTwoFactorComponent { private modalService: ModalService, stateService: StateService, route: ActivatedRoute, - logService: LogService + logService: LogService, + twoFactorService: TwoFactorService ) { super( authService, @@ -52,7 +54,8 @@ export class TwoFactorComponent extends BaseTwoFactorComponent { environmentService, stateService, route, - logService + logService, + twoFactorService ); super.onSuccessfulLogin = () => { return syncService.fullSync(true); diff --git a/src/app/services.module.ts b/src/app/services.module.ts index 5fdcef6b40..f240093fbf 100644 --- a/src/app/services.module.ts +++ b/src/app/services.module.ts @@ -16,7 +16,6 @@ import { SearchBarService } from "./layout/search/search-bar.service"; import { JslibServicesModule } from "jslib-angular/services/jslib-services.module"; -import { AuthService } from "jslib-common/services/auth.service"; import { ContainerService } from "jslib-common/services/container.service"; import { EventService } from "jslib-common/services/event.service"; import { SystemService } from "jslib-common/services/system.service"; @@ -24,7 +23,6 @@ import { VaultTimeoutService } from "jslib-common/services/vaultTimeout.service" import { ElectronCryptoService } from "jslib-electron/services/electronCrypto.service"; -import { AuthService as AuthServiceAbstraction } from "jslib-common/abstractions/auth.service"; import { BroadcasterService as BroadcasterServiceAbstraction } from "jslib-common/abstractions/broadcaster.service"; import { CryptoService as CryptoServiceAbstraction } from "jslib-common/abstractions/crypto.service"; import { CryptoFunctionService as CryptoFunctionServiceAbstraction } from "jslib-common/abstractions/cryptoFunction.service"; @@ -41,6 +39,7 @@ import { StateMigrationService as StateMigrationServiceAbstraction } from "jslib import { StorageService as StorageServiceAbstraction } from "jslib-common/abstractions/storage.service"; import { SyncService as SyncServiceAbstraction } from "jslib-common/abstractions/sync.service"; import { SystemService as SystemServiceAbstraction } from "jslib-common/abstractions/system.service"; +import { TwoFactorService as TwoFactorServiceAbstraction } from "jslib-common/abstractions/twoFactor.service"; import { VaultTimeoutService as VaultTimeoutServiceAbstraction } from "jslib-common/abstractions/vaultTimeout.service"; import { ThemeType } from "jslib-common/enums/themeType"; @@ -58,7 +57,7 @@ export function initFactory( vaultTimeoutService: VaultTimeoutService, i18nService: I18nService, eventService: EventService, - authService: AuthService, + twoFactorService: TwoFactorServiceAbstraction, notificationsService: NotificationsServiceAbstraction, platformUtilsService: PlatformUtilsServiceAbstraction, stateService: StateServiceAbstraction, @@ -74,7 +73,7 @@ export function initFactory( const locale = await stateService.getLocale(); await i18nService.init(locale); eventService.init(true); - authService.init(); + twoFactorService.init(); setTimeout(() => notificationsService.init(), 3000); const htmlEl = window.document.documentElement; htmlEl.classList.add("os_" + platformUtilsService.getDeviceString()); @@ -121,7 +120,7 @@ export function initFactory( VaultTimeoutServiceAbstraction, I18nServiceAbstraction, EventServiceAbstraction, - AuthServiceAbstraction, + TwoFactorServiceAbstraction, NotificationsServiceAbstraction, PlatformUtilsServiceAbstraction, StateServiceAbstraction,