fix(web): scope devFetch interceptor to dev mode only (GRO-127)

This commit is contained in:
Paperclip
2026-03-27 21:34:45 +00:00
parent 11be52a419
commit a46f3c50d1
+3
View File
@@ -9,6 +9,9 @@ const originalFetch = window.fetch;
* Intentionally mutates window.fetch — this is dev-only (AUTH_DISABLED=true).
*/
export function installDevFetchInterceptor() {
// In production, Better-Auth handles auth via cookies — no interception needed
if (!import.meta.env.DEV) return;
window.fetch = function (input: RequestInfo | URL, init?: RequestInit) {
const user = getDevUser();
if (!user) return originalFetch(input, init);