Skip to content

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

feat(auth): remove fetch with timeout (#41633)

Cemal Kılıç9450cdb7aaf7
diff --git a/packages/common/gotrue.ts b/packages/common/gotrue.ts
index d2e4ef08941..cd285c74d2e 100644
--- a/packages/common/gotrue.ts
+++ b/packages/common/gotrue.ts
@@ -200,27 +200,12 @@ async function debuggableNavigatorLock<R>(
}
}
-// Wrap fetch with 30-second timeout to prevent indefinite hangs
-const fetchWithTimeout: typeof fetch = async (input, init) => {
- const timeoutSignal = AbortSignal.timeout(30000) // 30 seconds
- const existingSignal = init?.signal
- const combinedSignal = existingSignal
- ? AbortSignal.any([existingSignal, timeoutSignal])
- : timeoutSignal
-
- return fetch(input, {
- ...init,
- signal: combinedSignal,
- })
-}
-
export const gotrueClient = new AuthClient({
url: process.env.NEXT_PUBLIC_GOTRUE_URL,
storageKey: STORAGE_KEY,
detectSessionInUrl: shouldDetectSessionInUrl,
debug: debug ? (persistedDebug ? logIndexedDB : true) : false,
lock: navigatorLockEnabled ? debuggableNavigatorLock : undefined,
- fetch: fetchWithTimeout,
...('localStorage' in globalThis
? { storage: globalThis.localStorage, userStorage: globalThis.localStorage }
: null),