Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

Add credentials include in all fetchers (#29834)

Joshen Lim9f02ee07b7b2
diff --git a/apps/studio/data/fetchers.ts b/apps/studio/data/fetchers.ts
index 8176e9678b8..7835a462188 100644
--- a/apps/studio/data/fetchers.ts
+++ b/apps/studio/data/fetchers.ts
@@ -52,6 +52,7 @@ export const get: typeof _get = async (url, init) => {
}
return await _get(url, {
+ credentials: 'include',
...init,
headers,
})
@@ -67,6 +68,7 @@ export const post: typeof _post = async (url, init) => {
}
return await _post(url, {
+ credentials: 'include',
...init,
headers,
})
@@ -82,6 +84,7 @@ export const put: typeof _put = async (url, init) => {
}
return await _put(url, {
+ credentials: 'include',
...init,
headers,
})
@@ -97,6 +100,7 @@ export const patch: typeof _patch = async (url, init) => {
}
return await _patch(url, {
+ credentials: 'include',
...init,
headers,
})
@@ -112,6 +116,7 @@ export const del: typeof _del = async (url, init) => {
}
return await _del(url, {
+ credentials: 'include',
...init,
headers,
})
@@ -127,6 +132,7 @@ export const head: typeof _head = async (url, init) => {
}
return await _head(url, {
+ credentials: 'include',
...init,
headers,
})
@@ -136,6 +142,7 @@ export const trace: typeof _trace = async (url, init) => {
const headers = await constructHeaders(init?.headers)
return await _trace(url, {
+ credentials: 'include',
...init,
headers,
})
@@ -145,6 +152,7 @@ export const options: typeof _options = async (url, init) => {
const headers = await constructHeaders(init?.headers)
return await _options(url, {
+ credentials: 'include',
...init,
headers,
})
diff --git a/apps/studio/data/telemetry/send-event-mutation.ts b/apps/studio/data/telemetry/send-event-mutation.ts
index 6fda99f2f3a..34add0c887d 100644
--- a/apps/studio/data/telemetry/send-event-mutation.ts
+++ b/apps/studio/data/telemetry/send-event-mutation.ts
@@ -28,11 +28,7 @@ export async function sendEvent(type: 'GA' | 'PH', body: SendEventPayload) {
if (consent !== 'true') return
const headers = type === 'PH' ? { Version: '2' } : undefined
- const { data, error } = await post(`/platform/telemetry/event`, {
- body,
- headers,
- credentials: 'include',
- })
+ const { data, error } = await post(`/platform/telemetry/event`, { body, headers })
if (error) handleError(error)
return data
}
diff --git a/apps/studio/data/telemetry/send-groups-identify-mutation.ts b/apps/studio/data/telemetry/send-groups-identify-mutation.ts
index 3d9130f18e7..1b3d241d4a4 100644
--- a/apps/studio/data/telemetry/send-groups-identify-mutation.ts
+++ b/apps/studio/data/telemetry/send-groups-identify-mutation.ts
@@ -7,10 +7,7 @@ import type { ResponseError } from 'types'
export type SendGroupsIdentifyVariables = components['schemas']['TelemetryGroupsIdentityBody']
export async function sendGroupsIdentify(body: SendGroupsIdentifyVariables) {
- const { data, error } = await post(`/platform/telemetry/groups/identify`, {
- body,
- credentials: 'include',
- })
+ const { data, error } = await post(`/platform/telemetry/groups/identify`, { body })
if (error) handleError(error)
return data
}
diff --git a/apps/studio/data/telemetry/send-groups-reset-mutation.ts b/apps/studio/data/telemetry/send-groups-reset-mutation.ts
index 0c6a157ae31..4d6e214d481 100644
--- a/apps/studio/data/telemetry/send-groups-reset-mutation.ts
+++ b/apps/studio/data/telemetry/send-groups-reset-mutation.ts
@@ -7,10 +7,7 @@ import type { ResponseError } from 'types'
export type SendGroupsResetVariables = components['schemas']['TelemetryGroupsResetBody']
export async function sendGroupsReset(body: SendGroupsResetVariables) {
- const { data, error } = await post(`/platform/telemetry/groups/reset`, {
- body,
- credentials: 'include',
- })
+ const { data, error } = await post(`/platform/telemetry/groups/reset`, { body })
if (error) handleError(error)
return data
}
diff --git a/apps/studio/data/telemetry/send-identify-mutation.ts b/apps/studio/data/telemetry/send-identify-mutation.ts
index b17b26ddda4..76d9eb5ab3d 100644
--- a/apps/studio/data/telemetry/send-identify-mutation.ts
+++ b/apps/studio/data/telemetry/send-identify-mutation.ts
@@ -28,11 +28,7 @@ export async function sendIdentify(type: 'GA' | 'PH', body: SendIdentifyPayload)
if (consent !== 'true') return
const headers = type === 'PH' ? { Version: '2' } : undefined
- const { data, error } = await post(`/platform/telemetry/identify`, {
- body,
- headers,
- credentials: 'include',
- })
+ const { data, error } = await post(`/platform/telemetry/identify`, { body, headers })
if (error) handleError(error)
return data
}
diff --git a/apps/studio/data/telemetry/send-page-leave-mutation.ts b/apps/studio/data/telemetry/send-page-leave-mutation.ts
index 9eaa46fcdd4..fc458c2f449 100644
--- a/apps/studio/data/telemetry/send-page-leave-mutation.ts
+++ b/apps/studio/data/telemetry/send-page-leave-mutation.ts
@@ -8,10 +8,7 @@ import type { ResponseError } from 'types'
type SendPageLeaveBody = components['schemas']['TelemetryPageLeaveBody']
export async function sendPageLeave(body: SendPageLeaveBody) {
- const { data, error } = await post(`/platform/telemetry/page-leave`, {
- body,
- credentials: 'include',
- })
+ const { data, error } = await post(`/platform/telemetry/page-leave`, { body })
if (error) handleError(error)
return data
}
diff --git a/apps/studio/data/telemetry/send-page-mutation.ts b/apps/studio/data/telemetry/send-page-mutation.ts
index 5bf477abe06..4d357c1be2a 100644
--- a/apps/studio/data/telemetry/send-page-mutation.ts
+++ b/apps/studio/data/telemetry/send-page-mutation.ts
@@ -18,11 +18,7 @@ type SendPagePayload = any
export async function sendPage(type: 'GA' | 'PH', body: SendPagePayload) {
const headers = type === 'PH' ? { Version: '2' } : undefined
- const { data, error } = await post(`/platform/telemetry/page`, {
- body,
- headers,
- credentials: 'include',
- })
+ const { data, error } = await post(`/platform/telemetry/page`, { body, headers })
if (error) handleError(error)
return data
}
diff --git a/apps/studio/data/telemetry/send-reset-mutation.ts b/apps/studio/data/telemetry/send-reset-mutation.ts
index 43b376d2ce7..c1056d8bf8f 100644
--- a/apps/studio/data/telemetry/send-reset-mutation.ts
+++ b/apps/studio/data/telemetry/send-reset-mutation.ts
@@ -4,7 +4,7 @@ import { handleError, post } from 'data/fetchers'
import type { ResponseError } from 'types'
export async function sendReset() {
- const { data, error } = await post(`/platform/telemetry/reset`, { credentials: 'include' })
+ const { data, error } = await post(`/platform/telemetry/reset`, {})
if (error) handleError(error)
return data
}