From 24165fef8e238be1ee13ad33bda4b76f79d16170 Mon Sep 17 00:00:00 2001 From: Jared Snider Date: Thu, 29 May 2025 13:25:04 -0400 Subject: [PATCH] PM-20532 - Register SendTokenService and SendTokenApiService --- libs/angular/src/services/jslib-services.module.ts | 14 ++++++++++++++ .../send-access/services/send-token.service.ts | 3 ++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/libs/angular/src/services/jslib-services.module.ts b/libs/angular/src/services/jslib-services.module.ts index bb3e2f50242..0528077696b 100644 --- a/libs/angular/src/services/jslib-services.module.ts +++ b/libs/angular/src/services/jslib-services.module.ts @@ -108,6 +108,10 @@ import { UserVerificationService as UserVerificationServiceAbstraction } from "@ import { WebAuthnLoginApiServiceAbstraction } from "@bitwarden/common/auth/abstractions/webauthn/webauthn-login-api.service.abstraction"; import { WebAuthnLoginPrfKeyServiceAbstraction } from "@bitwarden/common/auth/abstractions/webauthn/webauthn-login-prf-key.service.abstraction"; import { WebAuthnLoginServiceAbstraction } from "@bitwarden/common/auth/abstractions/webauthn/webauthn-login.service.abstraction"; +import { SendTokenApiService as SendTokenApiServiceAbstraction } from "@bitwarden/common/auth/send-access/abstractions/send-token-api.service"; +import { SendTokenService as SendTokenServiceAbstraction } from "@bitwarden/common/auth/send-access/abstractions/send-token.service"; +import { SendTokenApiService } from "@bitwarden/common/auth/send-access/services/send-token-api.service"; +import { SendTokenService } from "@bitwarden/common/auth/send-access/services/send-token.service"; import { AccountApiServiceImplementation } from "@bitwarden/common/auth/services/account-api.service"; import { AccountServiceImplementation } from "@bitwarden/common/auth/services/account.service"; import { AnonymousHubService } from "@bitwarden/common/auth/services/anonymous-hub.service"; @@ -1439,6 +1443,16 @@ const safeProviders: SafeProvider[] = [ useClass: SendPasswordService, deps: [CryptoFunctionServiceAbstraction], }), + safeProvider({ + provide: SendTokenApiServiceAbstraction, + useClass: SendTokenApiService, + deps: [EnvironmentService, ApiServiceAbstraction], + }), + safeProvider({ + provide: SendTokenServiceAbstraction, + useClass: SendTokenService, + deps: [GlobalStateProvider, SendTokenApiServiceAbstraction, SendPasswordService], + }), safeProvider({ provide: LoginComponentService, useClass: DefaultLoginComponentService, diff --git a/libs/common/src/auth/send-access/services/send-token.service.ts b/libs/common/src/auth/send-access/services/send-token.service.ts index eed30b6a5eb..c1a5dc963ef 100644 --- a/libs/common/src/auth/send-access/services/send-token.service.ts +++ b/libs/common/src/auth/send-access/services/send-token.service.ts @@ -12,13 +12,14 @@ import { SEND_ACCESS_DISK, } from "../../../platform/state"; import { SendAccessTokenRequest } from "../../models/request/identity-token/send-access-token.request"; +import { SendTokenApiService } from "../abstractions/send-token-api.service"; import { SendAccessCredentials, SendTokenService as SendTokenServiceAbstraction, } from "../abstractions/send-token.service"; import { SendAccessToken } from "../models/send-access-token"; -import { SendTokenApiRetrievalError, SendTokenApiService } from "./send-token-api.service"; +import { SendTokenApiRetrievalError } from "./send-token-api.service"; // TODO: add JSDocs // TODO: add tests for this service.