Update frontend/app/providers.tsx

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
2026-01-30 22:43:00 +00:00
committed by GitHub
parent f9d781271f
commit 32253724b0

View File

@@ -11,15 +11,15 @@ function AuthInitializer({ children }: { children: React.ReactNode }) {
const router = useRouter();
useEffect(() => {
// Initialize auth state
store.dispatch(initAuth());
// Set up global auth error handler
setAuthErrorCallback(() => {
setAuthErrorCallback(() => {
// Clear auth state and redirect to login
store.dispatch(setUnauthenticated());
router.push('/');
});
// Initialize auth state
store.dispatch(initAuth());
}, [router]);
return <>{children}</>;