Update auth-test.tsx

This commit is contained in:
Steve Ruiz 2021-06-20 08:43:45 +01:00
parent 2a96a587e2
commit 9e36c24800

View file

@ -2,8 +2,8 @@ import Head from 'next/head'
import { signIn, signOut, getSession, useSession } from 'next-auth/client'
import { GetServerSidePropsContext } from 'next'
export default function Home() {
const [session, loading] = useSession()
export default function Home({ session }: any) {
// const [session, loading] = useSession()
return (
<>
<Head>
@ -12,7 +12,6 @@ export default function Home() {
<div>
<button onClick={() => signIn()}>Sign In</button>
<button onClick={() => signOut()}>Sign Out</button>
<p>{loading && 'Loading...'}</p>
<pre>{JSON.stringify(session, null, 2)}</pre>
{session && <p>Hey, you made it! Thanks for sponsoring me.</p>}
</div>
@ -25,7 +24,7 @@ export async function getServerSideProps(context: GetServerSidePropsContext) {
return {
props: {
ssrSession: session,
session,
},
}
}