all repos — caroster @ 2b7fb817e6b5f6f8cec73d78960ce1695fa318a9

[Octree] Group carpool to your event https://caroster.io

frontend/pages/index.tsx (view raw)

 1import {getSession} from 'next-auth/react';
 2
 3const IndexPage = () => null;
 4
 5export const getServerSideProps = async context => {
 6  const session = await getSession(context);
 7
 8  if (session)
 9    return {
10      redirect: {
11        destination: '/dashboard',
12        permanent: false,
13      },
14    };
15  else
16    return {
17      redirect: {
18        destination: '/new',
19        permanent: false,
20      },
21    };
22};
23
24export default IndexPage;