From f36b39c68525f51fc4708ce99cd543cb28a56074 Mon Sep 17 00:00:00 2001 From: schroda <50052685+schroda@users.noreply.github.com> Date: Wed, 15 Oct 2025 23:39:56 +0200 Subject: [PATCH] Reset "auth required flag" on initial app load --- .../authentication/components/AuthGuard.tsx | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/src/features/authentication/components/AuthGuard.tsx b/src/features/authentication/components/AuthGuard.tsx index 154e684b..13f92c0a 100644 --- a/src/features/authentication/components/AuthGuard.tsx +++ b/src/features/authentication/components/AuthGuard.tsx @@ -6,12 +6,14 @@ * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ -import { ReactNode, useEffect } from 'react'; +import { ReactNode } from 'react'; import { useSessionContext } from '@/features/authentication/SessionContext.tsx'; import { SplashScreen } from '@/features/authentication/components/SplashScreen.tsx'; import { requestManager } from '@/lib/requests/RequestManager.ts'; import { AuthManager } from '@/features/authentication/AuthManager.ts'; +AuthManager.setAuthRequired(null); + export const AuthGuard = ({ children }: { children: ReactNode }) => { const { isAuthRequired } = useSessionContext(); @@ -28,15 +30,6 @@ export const AuthGuard = ({ children }: { children: ReactNode }) => { }, }); - useEffect(() => { - const handleUnload = () => { - AuthManager.setAuthRequired(null); - }; - - window.addEventListener('beforeunload', handleUnload); - return () => window.removeEventListener('beforeunload', handleUnload); - }, []); - if (isAuthRequired === null) { return ; }