Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

auth-test.tsx 560B

1234567891011121314151617181920
  1. import Head from 'next/head'
  2. import { signIn, signOut, useSession } from 'next-auth/client'
  3. export default function Home() {
  4. const [session, loading] = useSession()
  5. return (
  6. <>
  7. <Head>
  8. <title>tldraw</title>
  9. </Head>
  10. <div>
  11. <button onClick={() => signIn()}>Sign In</button>
  12. <button onClick={() => signOut()}>Sign Out</button>
  13. <pre>{JSON.stringify(session, null, 2)}</pre>
  14. {loading && 'Loading...'}
  15. {session && <p>Hey, you made it! Thanks for sponsoring me.</p>}
  16. </div>
  17. </>
  18. )
  19. }