fix(web): remove early-return guard from devFetch interceptor (GRO-406)
The if (!getDevUser()) return at install time prevented the interceptor from installing on app startup before any dev user was selected. Since the per-call check already handles the no-dev-user case correctly, the early-return guard is unnecessary and breaks the interceptor install in deployed dev builds. Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
@@ -9,10 +9,6 @@ const originalFetch = window.fetch;
|
||||
* Intentionally mutates window.fetch — this is dev-only (AUTH_DISABLED=true).
|
||||
*/
|
||||
export function installDevFetchInterceptor() {
|
||||
// Only install if a dev user is selected (localStorage check, not build-time flag).
|
||||
// This ensures the interceptor runs in deployed dev builds, not just `vite dev`.
|
||||
if (!getDevUser()) return;
|
||||
|
||||
window.fetch = function (input: RequestInfo | URL, init?: RequestInit) {
|
||||
const user = getDevUser();
|
||||
if (!user) return originalFetch(input, init);
|
||||
|
||||
Reference in New Issue
Block a user