fix: replace nested Routes with useLocation, remove pushState+reload, add debug logs
- ProfileRoutes: removed nested <Routes> in favor of useLocation()/useNavigate() with strict allowlist for /profile/me and /profile/me/edit - ProfileComponentWrapper: replaced pushState()+reload() with navigate() - useApi: log 401 and non-401 errors - contexts.tsx: log fetchCurrentUser lifecycle and auth:unauthorized events - axios.ts: log auth server 401s
This commit is contained in:
@@ -17,7 +17,9 @@ export function attachAuthInterceptors(client: AxiosInstance) {
|
||||
(res) => res,
|
||||
(error) => {
|
||||
if (error.response?.status === 401) {
|
||||
console.log("[authAxios] 401 from %s %s", error.config?.method, error.config?.url);
|
||||
tokenStore.clear();
|
||||
window.dispatchEvent(new CustomEvent("auth:unauthorized"));
|
||||
}
|
||||
return Promise.reject(error);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user