2
0

Add authentication

This commit is contained in:
Baptiste Arnaud
2021-11-29 15:19:07 +01:00
parent 68dd491eca
commit 5e14a94dea
51 changed files with 5036 additions and 90 deletions

View File

@ -0,0 +1,18 @@
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