1
0
mirror of https://github.com/bitwarden/directory-connector synced 2025-12-22 19:23:22 +00:00

[Tech debt] Refactor authService (#213)

* Add OrganizationLogInStrategy

* Use noop TwoFactorService
This commit is contained in:
Thomas Rittson
2022-02-08 13:38:46 +10:00
committed by GitHub
parent 910bfb945d
commit 1146c8f5bf
9 changed files with 158 additions and 97 deletions

View File

@@ -12,8 +12,8 @@ import { StateService } from "../../abstractions/state.service";
import { ModalService } from "jslib-angular/services/modal.service";
import { HtmlStorageLocation } from "jslib-common/enums/htmlStorageLocation";
import { Utils } from "jslib-common/misc/utils";
import { ApiLogInCredentials } from "jslib-common/models/domain/logInCredentials";
@Component({
selector: "app-apiKey",
@@ -76,7 +76,9 @@ export class ApiKeyComponent {
}
try {
this.formPromise = this.authService.logInApiKey(this.clientId, this.clientSecret);
this.formPromise = this.authService.logIn(
new ApiLogInCredentials(this.clientId, this.clientSecret)
);
await this.formPromise;
const organizationId = await this.stateService.getEntityId();
await this.stateService.setOrganizationId(organizationId);