index page redirection

This commit is contained in:
sriram veeraghanta 2023-04-05 14:40:36 -04:00
parent d45979eacb
commit 39f151ce73

View File

@ -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;