Problem
In api.ts (lines 61, 78-80), when token refresh fails, the code uses window.location.href = '/' which causes a full page reload and loses all React state.
Root Cause
The redirect was implemented before React Router was fully integrated.
What To Build
- Import and use React Router's
navigate function instead
- Or trigger a Zustand state reset that the router guard picks up
- Also call
clearTokens() from the store so Zustand state stays in sync
Files To Touch
src/services/api.ts — lines 61, 78-80 replace hard redirect
Acceptance Criteria
Mandatory Checks
Problem
In api.ts (lines 61, 78-80), when token refresh fails, the code uses
window.location.href = '/'which causes a full page reload and loses all React state.Root Cause
The redirect was implemented before React Router was fully integrated.
What To Build
navigatefunction insteadclearTokens()from the store so Zustand state stays in syncFiles To Touch
src/services/api.ts— lines 61, 78-80 replace hard redirectAcceptance Criteria
Mandatory Checks