Add authentication
This commit is contained in:
18
apps/builder/pages/index.tsx
Normal file
18
apps/builder/pages/index.tsx
Normal 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
|
Reference in New Issue
Block a user