Skip to content

Instantly share code, notes, and snippets.

import React from "react"
import { signIn, useSession } from "next-auth/client"
export default function Page() {
const [session, loading] = useSession()
if (loading) {
return <p>Loading...</p>
}
return (
<>
{session ? (
<p>Super secret page!</p>
) : (
<p>
<p>You are not permitted to see this page.</p>
<button onClick={signIn}>Sign in</button>
</p>
)}
</>
)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment