1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-11-05 09:10:53 +01:00

Update client for authService refactor (#1387)

Co-authored-by: Hinton <oscar@oscarhinton.com>
This commit is contained in:
Thomas Rittson 2022-02-08 05:24:49 +10:00 committed by GitHub
parent 6320498fb3
commit 1b28a4b954
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 15 additions and 13 deletions

2
jslib

@ -1 +1 @@
Subproject commit e0cc754d6fe962a5e7eae6d1dead8b44606d4853 Subproject commit 9caea70ea2dbfdb591ef08a3d33def7f591f1276

View File

@ -1,9 +1,9 @@
import { Component } from "@angular/core"; import { Component } from "@angular/core";
import { Router } from "@angular/router"; import { Router } from "@angular/router";
import { AuthService } from "jslib-common/abstractions/auth.service";
import { I18nService } from "jslib-common/abstractions/i18n.service"; import { I18nService } from "jslib-common/abstractions/i18n.service";
import { PlatformUtilsService } from "jslib-common/abstractions/platformUtils.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"; 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 { export class TwoFactorOptionsComponent extends BaseTwoFactorOptionsComponent {
constructor( constructor(
authService: AuthService, twoFactorService: TwoFactorService,
router: Router, router: Router,
i18nService: I18nService, i18nService: I18nService,
platformUtilsService: PlatformUtilsService platformUtilsService: PlatformUtilsService
) { ) {
super(authService, router, i18nService, platformUtilsService, window); super(twoFactorService, router, i18nService, platformUtilsService, window);
} }
} }

View File

@ -9,6 +9,7 @@ import { I18nService } from "jslib-common/abstractions/i18n.service";
import { LogService } from "jslib-common/abstractions/log.service"; import { LogService } from "jslib-common/abstractions/log.service";
import { PlatformUtilsService } from "jslib-common/abstractions/platformUtils.service"; import { PlatformUtilsService } from "jslib-common/abstractions/platformUtils.service";
import { StateService } from "jslib-common/abstractions/state.service"; import { StateService } from "jslib-common/abstractions/state.service";
import { TwoFactorService } from "jslib-common/abstractions/twoFactor.service";
import { ModalService } from "jslib-angular/services/modal.service"; import { ModalService } from "jslib-angular/services/modal.service";
@ -36,7 +37,8 @@ export class TwoFactorComponent extends BaseTwoFactorComponent {
environmentService: EnvironmentService, environmentService: EnvironmentService,
private modalService: ModalService, private modalService: ModalService,
route: ActivatedRoute, route: ActivatedRoute,
logService: LogService logService: LogService,
twoFactorService: TwoFactorService
) { ) {
super( super(
authService, authService,
@ -48,7 +50,8 @@ export class TwoFactorComponent extends BaseTwoFactorComponent {
environmentService, environmentService,
stateService, stateService,
route, route,
logService logService,
twoFactorService
); );
this.onSuccessfulLoginNavigate = this.goAfterLogIn; this.onSuccessfulLoginNavigate = this.goAfterLogIn;
} }

View File

@ -1,4 +1,4 @@
import { APP_INITIALIZER, Injector, NgModule } from "@angular/core"; import { APP_INITIALIZER, NgModule } from "@angular/core";
import { ToastrModule } from "ngx-toastr"; import { ToastrModule } from "ngx-toastr";
import { BroadcasterMessagingService } from "../../services/broadcasterMessaging.service"; import { BroadcasterMessagingService } from "../../services/broadcasterMessaging.service";
@ -20,7 +20,6 @@ import { RouterService } from "./router.service";
import { JslibServicesModule } from "jslib-angular/services/jslib-services.module"; import { JslibServicesModule } from "jslib-angular/services/jslib-services.module";
import { ModalService as ModalServiceAbstraction } from "jslib-angular/services/modal.service"; import { ModalService as ModalServiceAbstraction } from "jslib-angular/services/modal.service";
import { AuthService } from "jslib-common/services/auth.service";
import { ContainerService } from "jslib-common/services/container.service"; import { ContainerService } from "jslib-common/services/container.service";
import { CryptoService } from "jslib-common/services/crypto.service"; import { CryptoService } from "jslib-common/services/crypto.service";
import { EventService as EventLoggingService } from "jslib-common/services/event.service"; import { EventService as EventLoggingService } from "jslib-common/services/event.service";
@ -28,7 +27,6 @@ import { ImportService } from "jslib-common/services/import.service";
import { VaultTimeoutService } from "jslib-common/services/vaultTimeout.service"; import { VaultTimeoutService } from "jslib-common/services/vaultTimeout.service";
import { ApiService as ApiServiceAbstraction } from "jslib-common/abstractions/api.service"; import { ApiService as ApiServiceAbstraction } from "jslib-common/abstractions/api.service";
import { AuthService as AuthServiceAbstraction } from "jslib-common/abstractions/auth.service";
import { CipherService as CipherServiceAbstraction } from "jslib-common/abstractions/cipher.service"; import { CipherService as CipherServiceAbstraction } from "jslib-common/abstractions/cipher.service";
import { CollectionService as CollectionServiceAbstraction } from "jslib-common/abstractions/collection.service"; import { CollectionService as CollectionServiceAbstraction } from "jslib-common/abstractions/collection.service";
import { CryptoService as CryptoServiceAbstraction } from "jslib-common/abstractions/crypto.service"; import { CryptoService as CryptoServiceAbstraction } from "jslib-common/abstractions/crypto.service";
@ -49,6 +47,7 @@ import { PlatformUtilsService as PlatformUtilsServiceAbstraction } from "jslib-c
import { StateService as BaseStateServiceAbstraction } from "jslib-common/abstractions/state.service"; import { StateService as BaseStateServiceAbstraction } from "jslib-common/abstractions/state.service";
import { StateMigrationService as StateMigrationServiceAbstraction } from "jslib-common/abstractions/stateMigration.service"; import { StateMigrationService as StateMigrationServiceAbstraction } from "jslib-common/abstractions/stateMigration.service";
import { StorageService as StorageServiceAbstraction } from "jslib-common/abstractions/storage.service"; import { StorageService as StorageServiceAbstraction } from "jslib-common/abstractions/storage.service";
import { TwoFactorService as TwoFactorServiceAbstraction } from "jslib-common/abstractions/twoFactor.service";
import { VaultTimeoutService as VaultTimeoutServiceAbstraction } from "jslib-common/abstractions/vaultTimeout.service"; import { VaultTimeoutService as VaultTimeoutServiceAbstraction } from "jslib-common/abstractions/vaultTimeout.service";
import { ThemeType } from "jslib-common/enums/themeType"; import { ThemeType } from "jslib-common/enums/themeType";
@ -68,7 +67,7 @@ export function initFactory(
vaultTimeoutService: VaultTimeoutService, vaultTimeoutService: VaultTimeoutService,
i18nService: I18nService, i18nService: I18nService,
eventLoggingService: EventLoggingService, eventLoggingService: EventLoggingService,
authService: AuthService, twoFactorService: TwoFactorServiceAbstraction,
stateService: StateServiceAbstraction, stateService: StateServiceAbstraction,
platformUtilsService: PlatformUtilsServiceAbstraction, platformUtilsService: PlatformUtilsServiceAbstraction,
cryptoService: CryptoServiceAbstraction cryptoService: CryptoServiceAbstraction
@ -86,7 +85,7 @@ export function initFactory(
const locale = await stateService.getLocale(); const locale = await stateService.getLocale();
await i18nService.init(locale); await i18nService.init(locale);
eventLoggingService.init(true); eventLoggingService.init(true);
authService.init(); twoFactorService.init();
const htmlEl = window.document.documentElement; const htmlEl = window.document.documentElement;
htmlEl.classList.add("locale_" + i18nService.translationLocale); htmlEl.classList.add("locale_" + i18nService.translationLocale);
@ -118,7 +117,7 @@ export function initFactory(
VaultTimeoutServiceAbstraction, VaultTimeoutServiceAbstraction,
I18nServiceAbstraction, I18nServiceAbstraction,
EventLoggingServiceAbstraction, EventLoggingServiceAbstraction,
AuthServiceAbstraction, TwoFactorServiceAbstraction,
StateServiceAbstraction, StateServiceAbstraction,
PlatformUtilsServiceAbstraction, PlatformUtilsServiceAbstraction,
CryptoServiceAbstraction, CryptoServiceAbstraction,

View File

@ -5,7 +5,7 @@ import { MessagingService } from "jslib-common/abstractions/messaging.service";
import { PolicyService } from "jslib-common/abstractions/policy.service"; import { PolicyService } from "jslib-common/abstractions/policy.service";
import { StateService } from "jslib-common/abstractions/state.service"; import { StateService } from "jslib-common/abstractions/state.service";
import { TwoFactorProviders } from "jslib-common/services/auth.service"; import { TwoFactorProviders } from "jslib-common/services/twoFactor.service";
import { ModalService } from "jslib-angular/services/modal.service"; import { ModalService } from "jslib-angular/services/modal.service";