From efd99d07388213f8b72cbe387b484971353e4ece Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Jos=C3=A9=20Ram=C3=ADrez?= Date: Wed, 1 Oct 2025 14:59:17 -0300 Subject: [PATCH] fix: dont redirect to setup if user is not logged in --- src/app/(mobile-ui)/layout.tsx | 9 --------- 1 file changed, 9 deletions(-) diff --git a/src/app/(mobile-ui)/layout.tsx b/src/app/(mobile-ui)/layout.tsx index 33b0feb11..e7a2812f9 100644 --- a/src/app/(mobile-ui)/layout.tsx +++ b/src/app/(mobile-ui)/layout.tsx @@ -1,7 +1,6 @@ 'use client' import { MarqueeWrapper } from '@/components/Global/MarqueeWrapper' -import { useRouter } from 'next/navigation' import { HandThumbsUp } from '@/assets' import Image from 'next/image' import GuestLoginModal from '@/components/Global/GuestLoginModal' @@ -26,7 +25,6 @@ const publicPathRegex = /^\/(request\/pay|claim|pay\/.+$|support)/ const Layout = ({ children }: { children: React.ReactNode }) => { const pathName = usePathname() - const router = useRouter() const { isFetchingUser, user } = useAuth() const [isReady, setIsReady] = useState(false) const [hasToken, setHasToken] = useState(false) @@ -79,13 +77,6 @@ const Layout = ({ children }: { children: React.ReactNode }) => { // Allow access to public paths without authentication const isPublicPath = publicPathRegex.test(pathName) - // redirect to setup if user is not logged in - useEffect(() => { - if (!isFetchingUser && !user) { - router.push('/setup') - } - }, [user, isFetchingUser, router]) - if (!isReady || !user || (isFetchingUser && !hasToken && !isPublicPath)) { return (