fix: redir parameter for connect atoms (#22815)
* encode redirect url to make sure it has all parameters * add changesets
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user