1
0
mirror of https://github.com/bitwarden/jslib synced 2025-12-25 20:53:28 +00:00

[Tech debt] Refactor authService and remove LogInHelper (#588)

* Use different strategy classes for different types of login
* General refactor and cleanup of auth logic
* Create subclasses for different types of login credentials
* Create subclasses for different types of tokenRequests
* Create TwoFactorService, move code out of authService
* refactor base CLI commands to use new interface
This commit is contained in:
Thomas Rittson
2022-02-01 09:51:32 +10:00
committed by GitHub
parent 92a65b7b36
commit aa2bdd00be
31 changed files with 1798 additions and 920 deletions

View File

@@ -6,6 +6,7 @@ import { TwoFactorProviderType } from "jslib-common/enums/twoFactorProviderType"
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";
@Directive()
export class TwoFactorOptionsComponent implements OnInit {
@@ -15,7 +16,7 @@ export class TwoFactorOptionsComponent implements OnInit {
providers: any[] = [];
constructor(
protected authService: AuthService,
protected twoFactorService: TwoFactorService,
protected router: Router,
protected i18nService: I18nService,
protected platformUtilsService: PlatformUtilsService,
@@ -23,7 +24,7 @@ export class TwoFactorOptionsComponent implements OnInit {
) {}
ngOnInit() {
this.providers = this.authService.getSupportedTwoFactorProviders(this.win);
this.providers = this.twoFactorService.getSupportedProviders(this.win);
}
choose(p: any) {