2
0
Files
bot/apps/builder/pages/index.tsx
Baptiste Arnaud 5e14a94dea Add authentication
2021-11-29 15:19:07 +01:00

19 lines
462 B
TypeScript

import { GetServerSidePropsContext } from 'next'
import { getSession } from 'next-auth/react'
function RedirectPage() {
return
}
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' } }
}
export default RedirectPage