From 39f151ce731871d0959259e612fb51b1b3e8df69 Mon Sep 17 00:00:00 2001 From: sriram veeraghanta Date: Wed, 5 Apr 2023 14:40:36 -0400 Subject: [PATCH] index page redirection --- apps/app/pages/index.tsx | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/apps/app/pages/index.tsx b/apps/app/pages/index.tsx index a795211ff..5bb60c4fb 100644 --- a/apps/app/pages/index.tsx +++ b/apps/app/pages/index.tsx @@ -1,13 +1,15 @@ -// lib +import { useEffect } from "react"; import { homePageRedirect } from "lib/auth"; // types import type { NextPage, NextPageContext } from "next"; +import { useRouter } from "next/router"; -const Home: NextPage = () => null; +const Home: NextPage = () => { + const router = useRouter(); -export const getServerSideProps = (ctx: NextPageContext) => { - const cookies = ctx.req?.headers.cookie; - return homePageRedirect(cookies); + useEffect(() => { + router.push("/onboarding"); + }, []); + return <>loading; }; - export default Home;