Skip to content

Commit dc967cf

Browse files
authored
fix: redir parameter for connect atoms (calcom#22815)
* encode redirect url to make sure it has all parameters * add changesets
1 parent 4489cb8 commit dc967cf

2 files changed

Lines changed: 9 additions & 1 deletion

File tree

.changeset/short-foxes-crash.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"@calcom/atoms": patch
3+
---
4+
5+
This change fixes an issue in the CalendarSettings atom where the redirect urls were getting only one search param
6+

packages/platform/atoms/hooks/connect/useConnect.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,16 @@ export const useGetRedirectUrl = (
1818
redir?: string,
1919
isDryRun?: boolean
2020
) => {
21+
const redirectUrl = !!redir ? encodeURIComponent(redir) : "";
22+
2123
const authUrl = useQuery({
2224
queryKey: getQueryKey(calendar),
2325
staleTime: Infinity,
2426
enabled: false,
2527
queryFn: () => {
2628
return http
2729
?.get<ApiResponse<{ authUrl: string }>>(
28-
`/calendars/${calendar}/connect?redir=${redir ?? ""}&isDryRun=${isDryRun ?? ""}`
30+
`/calendars/${calendar}/connect?redir=${redirectUrl}&isDryRun=${isDryRun ?? ""}`
2931
)
3032
.then(({ data: responseBody }) => {
3133
if (responseBody.status === SUCCESS_STATUS) {

0 commit comments

Comments
 (0)