Update auth-test.tsx
This commit is contained in:
parent
2a96a587e2
commit
9e36c24800
1 changed files with 3 additions and 4 deletions
|
@ -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,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue