From ca0fa88bb56245103cbac32836c5a63035b45804 Mon Sep 17 00:00:00 2001 From: Manav Rathi Date: Sun, 30 Jun 2024 18:56:39 +0530 Subject: [PATCH] Incl x-c-p in all API fetches --- web/apps/accounts/src/services/passkey.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/web/apps/accounts/src/services/passkey.ts b/web/apps/accounts/src/services/passkey.ts index fdb87df4e4..ce25d05ed3 100644 --- a/web/apps/accounts/src/services/passkey.ts +++ b/web/apps/accounts/src/services/passkey.ts @@ -1,5 +1,6 @@ import { clientPackageName } from "@/next/app"; import { isDevBuild } from "@/next/env"; +import { clientPackageHeader } from "@/next/http"; import { apiURL } from "@/next/origins"; import { TwoFactorAuthorizationResponse } from "@/next/types/credentials"; import { ensure } from "@/utils/ensure"; @@ -415,6 +416,7 @@ export const beginPasskeyAuthentication = async ( const url = await apiURL("/users/two-factor/passkeys/begin"); const res = await fetch(url, { method: "POST", + headers: clientPackageHeader(), body: JSON.stringify({ sessionID: passkeySessionID }), }); if (!res.ok) { @@ -506,6 +508,8 @@ export const finishPasskeyAuthentication = async ({ const res = await fetch(`${url}?${params.toString()}`, { method: "POST", headers: { + // Note: Unlike the other requests, this is the clientPackage of the + // _requesting_ app, not the accounts app. "X-Client-Package": clientPackage, }, body: JSON.stringify({