chore: ignore oAuthClientId for Booker Embed bookings (#18314)
* chore: ignore oAuthClientId for Booker Embed bookings * remove logs * chore: isEmbed header and emails * fixup! chore: isEmbed header and emails * fixup! fixup! chore: isEmbed header and emails * fixup! fixup! fixup! chore: isEmbed header and emails * fixup! fixup! fixup! fixup! chore: isEmbed header and emails * fixup! fixup! fixup! fixup! fixup! chore: isEmbed header and emails --------- Co-authored-by: Ryukemeister <[email protected]> Co-authored-by: Rajiv Sahal <[email protected]>
This commit is contained in:
5 files changed
+46
-15
No files matched your search
@@ -112,6 +112,10 @@ export function CalProvider({
|
||||
}
|
||||
}, [accessToken]);
|
||||
|
||||
useEffect(() => {
|
||||
http.setPlatformEmbedHeader(isEmbed);
|
||||
}, [isEmbed]);
|
||||
|
||||
return (
|
||||
<QueryClientProvider client={queryClient}>
|
||||
<BaseCalProvider
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import axios from "axios";
|
||||
|
||||
import { CAL_API_VERSION_HEADER, X_CAL_CLIENT_ID } from "@calcom/platform-constants";
|
||||
import { CAL_API_VERSION_HEADER, X_CAL_CLIENT_ID, X_CAL_PLATFORM_EMBED } from "@calcom/platform-constants";
|
||||
|
||||
// Immediately Invoked Function Expression to create simple singleton class like
|
||||
|
||||
@@ -42,6 +42,12 @@ const http = (function () {
|
||||
getClientIdHeader: () => {
|
||||
return instance.defaults.headers.common?.[X_CAL_CLIENT_ID]?.toString() ?? "";
|
||||
},
|
||||
setPlatformEmbedHeader: (isEmbed: boolean) => {
|
||||
instance.defaults.headers.common[X_CAL_PLATFORM_EMBED] = isEmbed.toString();
|
||||
},
|
||||
getPlatformEmbedHeader: () => {
|
||||
return instance.defaults.headers.common?.[X_CAL_PLATFORM_EMBED]?.toString() ?? "";
|
||||
},
|
||||
setVersionHeader: (clientId: string) => {
|
||||
instance.defaults.headers.common[CAL_API_VERSION_HEADER] = clientId;
|
||||
},
|
||||
|
||||
@@ -48,6 +48,7 @@ export const API_ERROR_CODES = [
|
||||
// Request headers
|
||||
export const X_CAL_SECRET_KEY = "x-cal-secret-key";
|
||||
export const X_CAL_CLIENT_ID = "x-cal-client-id";
|
||||
export const X_CAL_PLATFORM_EMBED = "x-cal-platform-embed";
|
||||
|
||||
// HTTP status codes
|
||||
export const HTTP_CODE_TOKEN_EXPIRED = 498;
|
||||
|
||||
Reference in new issue
Block a user