diff --git a/next.config.ts b/next.config.ts index c781a8ac..b2d25eb6 100644 --- a/next.config.ts +++ b/next.config.ts @@ -3,6 +3,7 @@ import type { NextConfig } from 'next'; const nextConfig: NextConfig = { output: 'export', images: { unoptimized: true }, + trailingSlash: true, }; export default nextConfig; diff --git a/src/app/page.tsx b/src/app/page.tsx index 0330b478..9fe5b724 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -1,5 +1,6 @@ 'use client'; +import { useEffect } from 'react'; import { usePathname, useRouter } from 'next/navigation'; import { useAuth } from '@/services/hooks/useAuth'; import { redirectToSSO } from '@/lib/auth-helper'; @@ -10,9 +11,11 @@ export default function Home() { const router = useRouter(); const pathname = usePathname(); - if (pathname === '/') { - router.replace('/dashboard'); - } + useEffect(() => { + if (pathname === '/') { + router.replace('/dashboard'); + } + }, [pathname]); if (isLoadingUser) { return (