logout issues # 2
This commit is contained in:
@@ -158,23 +158,7 @@ const Tooltips = lazy(() => import("./pages/Settings/UiElements/Tooltips"));
|
||||
const Videos = lazy(() => import("./pages/Settings/UiElements/Videos"));
|
||||
|
||||
export default function App() {
|
||||
const isAuthenticated = useAuthStore((state) => state.isAuthenticated);
|
||||
const refreshUser = useAuthStore((state) => state.refreshUser);
|
||||
const logout = useAuthStore((state) => state.logout);
|
||||
|
||||
useEffect(() => {
|
||||
const { token } = useAuthStore.getState();
|
||||
if (!isAuthenticated || !token) return;
|
||||
|
||||
refreshUser().catch((error) => {
|
||||
// Avoid log spam on auth pages when token is missing/expired
|
||||
if (error?.message?.includes('Authentication credentials were not provided')) {
|
||||
return;
|
||||
}
|
||||
console.warn('Session validation failed:', error);
|
||||
logout();
|
||||
});
|
||||
}, [isAuthenticated, refreshUser, logout]);
|
||||
// All session validation removed - API interceptor handles authentication
|
||||
|
||||
return (
|
||||
<>
|
||||
|
||||
Reference in New Issue
Block a user