diff --git a/apps/web/src/context/AuthContext.tsx b/apps/web/src/context/AuthContext.tsx index b2381889..554cb249 100644 --- a/apps/web/src/context/AuthContext.tsx +++ b/apps/web/src/context/AuthContext.tsx @@ -212,10 +212,7 @@ export const AuthProvider = ({ children }: any) => { DefaultService.appControllerLogout().then(() => setUser(undefined)); // Don't redirect if we are already on the signin page since it will cause a loop if (router.pathname !== '/signin') { - // there can be a case where we push to another page before the logout is complete - while (router.pathname !== '/signin') { - router.push('/signin'); - } + router.replace('/signin'); } };