fix: redir parameter for connect atoms (#22815)

* encode redirect url to make sure it has all parameters

* add changesets
This commit is contained in:
Rajiv Sahal
2025-07-30 15:00:54 +00:00
committed by GitHub
parent 4489cb8fde
commit dc967cffbe
2 changed files with 9 additions and 1 deletions
+6
View File
@@ -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
@@ -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<ApiResponse<{ authUrl: string }>>(
`/calendars/${calendar}/connect?redir=${redir ?? ""}&isDryRun=${isDryRun ?? ""}`
`/calendars/${calendar}/connect?redir=${redirectUrl}&isDryRun=${isDryRun ?? ""}`
)
.then(({ data: responseBody }) => {
if (responseBody.status === SUCCESS_STATUS) {