Skip to content

Commit 0e43225

Browse files
authored
Merge pull request #19476 from mozilla/pay-3275-sanitize-plan-eligibility
fix(auth): sanitize plan on eligiblity check
2 parents da55ebd + 0b48430 commit 0e43225

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

  • packages/fxa-auth-server/lib/routes/subscriptions

packages/fxa-auth-server/lib/routes/subscriptions/mozilla.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import type { AppendedPlayStoreSubscriptionPurchase } from 'fxa-shared/payments/
2626
import type { AppendedAppStoreSubscriptionPurchase } from 'fxa-shared/payments/iap/apple-app-store/types';
2727
import { VError } from 'verror';
2828
import type { ConfigType } from '../../../config';
29+
import { sanitizePlans } from './stripe';
2930

3031
const DEFAULT_CURRENCY = 'usd';
3132

@@ -227,7 +228,9 @@ export class MozillaSubscriptionHandler {
227228

228229
return {
229230
eligibility: result.subscriptionEligibilityResult,
230-
currentPlan: result.eligibleSourcePlan,
231+
currentPlan:
232+
result.eligibleSourcePlan &&
233+
sanitizePlans([result.eligibleSourcePlan]).at(0),
231234
};
232235
}
233236
}

0 commit comments

Comments
 (0)