Add auth and theme switcher
This commit is contained in:
15
src/components/auth/SignInOutButton.tsx
Normal file
15
src/components/auth/SignInOutButton.tsx
Normal file
@ -0,0 +1,15 @@
|
||||
"use client"
|
||||
|
||||
import { signIn, signOut } from "next-auth/react"
|
||||
|
||||
export function SignInOutButton({ session }: { session: any }) {
|
||||
return session ? (
|
||||
<button onClick={() => signOut()} className="text-sm underline">
|
||||
Sign out
|
||||
</button>
|
||||
) : (
|
||||
<button onClick={() => signIn("github")} className="text-sm underline">
|
||||
Sign in with GitHub
|
||||
</button>
|
||||
)
|
||||
}
|
Reference in New Issue
Block a user