Skip to content

Commit

Permalink
Merge pull request #18120 from mozilla/fxa-10851
Browse files Browse the repository at this point in the history
fix(metrics): pass the `service` value to the linked account login endpoint
  • Loading branch information
vbudhram authored Dec 9, 2024
2 parents 23f8f3f + 89ae274 commit fb2c2fb
Showing 1 changed file with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -124,11 +124,18 @@ const ThirdPartyAuthCallback = ({
}

try {
const fxaParams = integration.getFxAParams();
let originalService;
if (fxaParams) {
const params = new URLSearchParams(fxaParams);
originalService =
params.get('service') || params.get('client_id') || undefined;
}
const linkedAccount: LinkedAccountData =
await account.verifyAccountThirdParty(
thirdPartyOAuthCode,
provider,
undefined,
originalService,
queryParamsToMetricsContext(
flowQueryParams as unknown as Record<string, string>
)
Expand All @@ -141,8 +148,6 @@ const ThirdPartyAuthCallback = ({

setCurrentAccount(linkedAccount.uid);

const fxaParams = integration.getFxAParams();

// HACK: Hard navigate is required here to ensure that the new integration
// is created based off updated search params.
hardNavigate(
Expand Down

0 comments on commit fb2c2fb

Please sign in to comment.