2
0
Files
bot/apps/builder/src/pages/index.tsx
2022-11-15 15:14:38 +01:00

17 lines
445 B
TypeScript

import { GetServerSidePropsContext } from 'next'
import { getSession } from 'next-auth/react'
export default function Page() {
return null
}
export const getServerSideProps = async (
context: GetServerSidePropsContext
) => {
const session = await getSession(context)
if (!session?.user) {
return { redirect: { permanent: false, destination: '/signin' } }
}
return { redirect: { permanent: false, destination: '/typebots' } }
}