From 7bed17ba8ee4b64fb021db3f967159d2823878d5 Mon Sep 17 00:00:00 2001 From: Reino Muhl <10620585+StaberindeZA@users.noreply.github.com> Date: Thu, 5 Sep 2024 16:02:42 -0400 Subject: [PATCH] fix(auth): missing profile client references Because: - Some code was still referencing the auth-server profile client This commit: - Update code to reference the profile client library Closes #FXA-10389 --- packages/fxa-auth-server/lib/routes/account.ts | 11 ++--------- packages/fxa-auth-server/test/local/routes/account.js | 3 ++- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/packages/fxa-auth-server/lib/routes/account.ts b/packages/fxa-auth-server/lib/routes/account.ts index 781f314388..39ac365933 100644 --- a/packages/fxa-auth-server/lib/routes/account.ts +++ b/packages/fxa-auth-server/lib/routes/account.ts @@ -33,9 +33,8 @@ import { appStoreSubscriptionPurchaseToAppStoreSubscriptionDTO, playStoreSubscriptionPurchaseToPlayStoreSubscriptionDTO, } from '../payments/iap/iap-formatter'; -import { PayPalHelper } from '../payments/paypal/helper'; import { StripeHelper } from '../payments/stripe'; -import { AuthLogger, AuthRequest, ProfileClient } from '../types'; +import { AuthLogger, AuthRequest } from '../types'; import { deleteAccountIfUnverified } from './utils/account'; import emailUtils from './utils/email'; import requestHelper from './utils/request_helper'; @@ -45,6 +44,7 @@ import { gleanMetrics } from '../metrics/glean'; import { AccountDeleteManager } from '../account-delete'; import { uuidTransformer } from 'fxa-shared/db/transformers'; import { AccountTasks, ReasonForDeletion } from '@fxa/shared/cloud-tasks'; +import { ProfileClient } from '@fxa/profile/client'; const METRICS_CONTEXT_SCHEMA = require('../metrics/context').schema; @@ -58,7 +58,6 @@ const MS_ONE_MONTH = MS_ONE_DAY * 30; export class AccountHandler { private OAUTH_DISABLE_NEW_CONNECTIONS_FOR_CLIENTS: Set; - private paypalHelper?: PayPalHelper; private otpUtils: any; private otpOptions: ConfigType['otp']; private skipConfirmationForEmailAddresses: string[]; @@ -94,12 +93,6 @@ export class AccountHandler { this.otpOptions = config.otp; - if ( - stripeHelper && - config.subscriptions?.paypalNvpSigCredentials?.enabled - ) { - this.paypalHelper = Container.get(PayPalHelper); - } this.capabilityService = Container.get(CapabilityService); this.accountEventsManager = Container.get(AccountEventsManager); this.accountDeleteManager = Container.get(AccountDeleteManager); diff --git a/packages/fxa-auth-server/test/local/routes/account.js b/packages/fxa-auth-server/test/local/routes/account.js index ec6c405cdd..4f8c5ebf29 100644 --- a/packages/fxa-auth-server/test/local/routes/account.js +++ b/packages/fxa-auth-server/test/local/routes/account.js @@ -32,8 +32,9 @@ const { const { deleteAccountIfUnverified, } = require('../../../lib/routes/utils/account'); -const { AppConfig, AuthLogger, ProfileClient } = require('../../../lib/types'); +const { AppConfig, AuthLogger } = require('../../../lib/types'); const defaultConfig = require('../../../config').default.getProperties(); +const { ProfileClient } = require('@fxa/profile/client'); const glean = mocks.mockGlean(); const profile = mocks.mockProfile();