You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1234567891011121314151617181920212223242526272829303132
  1. import dynamic from 'next/dynamic'
  2. import { GetServerSideProps } from 'next'
  3. import { getSession } from 'next-auth/client'
  4. import Head from 'next/head'
  5. const Editor = dynamic(() => import('components/editor'), { ssr: false })
  6. export default function Shhh(): JSX.Element {
  7. return (
  8. <>
  9. <Head>
  10. <title>tldraw</title>
  11. </Head>
  12. <Editor id="home" />
  13. </>
  14. )
  15. }
  16. export const getServerSideProps: GetServerSideProps = async (context) => {
  17. const session = await getSession(context)
  18. if (!session?.user && process.env.NODE_ENV !== 'development') {
  19. context.res.setHeader('Location', `/sponsorware`)
  20. context.res.statusCode = 307
  21. }
  22. return {
  23. props: {
  24. session,
  25. },
  26. }
  27. }