mirror of
https://github.com/johndoe6345789/docker-swarm-termina.git
synced 2026-04-24 13:45:01 +00:00
Update frontend/app/providers.tsx
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -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}</>;
|
||||
|
||||
Reference in New Issue
Block a user