diff --git a/.changeset/short-foxes-crash.md b/.changeset/short-foxes-crash.md new file mode 100644 index 0000000000..a7b452fe8f --- /dev/null +++ b/.changeset/short-foxes-crash.md @@ -0,0 +1,6 @@ +--- +"@calcom/atoms": patch +--- + +This change fixes an issue in the CalendarSettings atom where the redirect urls were getting only one search param + diff --git a/packages/platform/atoms/hooks/connect/useConnect.ts b/packages/platform/atoms/hooks/connect/useConnect.ts index fe261c2bf4..bff70c92bd 100644 --- a/packages/platform/atoms/hooks/connect/useConnect.ts +++ b/packages/platform/atoms/hooks/connect/useConnect.ts @@ -18,6 +18,8 @@ export const useGetRedirectUrl = ( redir?: string, isDryRun?: boolean ) => { + const redirectUrl = !!redir ? encodeURIComponent(redir) : ""; + const authUrl = useQuery({ queryKey: getQueryKey(calendar), staleTime: Infinity, @@ -25,7 +27,7 @@ export const useGetRedirectUrl = ( queryFn: () => { return http ?.get>( - `/calendars/${calendar}/connect?redir=${redir ?? ""}&isDryRun=${isDryRun ?? ""}` + `/calendars/${calendar}/connect?redir=${redirectUrl}&isDryRun=${isDryRun ?? ""}` ) .then(({ data: responseBody }) => { if (responseBody.status === SUCCESS_STATUS) {