Skip to content

Commit

Permalink
feat: add components
Browse files Browse the repository at this point in the history
  • Loading branch information
subfuzion committed Mar 11, 2023
1 parent 8fcf8bf commit c63268b
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions src/components/login-btn.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import { useSession, signIn, signOut } from "next-auth/react"

export default function Component() {
const { data: session } = useSession()
if (session) {
return (
<>
Signed in as {session.user?.email} <br />
<button onClick={() => signOut()}>Sign out</button>
<hr/>
<div>
{JSON.stringify(session)}
</div>
</>
)
}
return (
<>
Not signed in <br />
<button onClick={() => signIn()}>Sign in</button>
<hr/>
<div>
{JSON.stringify(session)}
</div>
</>
)
}

0 comments on commit c63268b

Please sign in to comment.