Answers for "how to install next-auth/client"

3

install next auth

npm i --save next-auth
Posted by: Guest on May-28-2021
0

install next-auth

import { useSession, signIn, signOut } from "next-auth/client"

export default function Component() {
  const [session, loading] = useSession()
  if (session) {
    return (
      <>
        Signed in as {session.user.email} <br />
        <button onClick={() => signOut()}>Sign out</button>
      </>
    )
  }
  return (
    <>
      Not signed in <br />
      <button onClick={() => signIn()}>Sign in</button>
    </>
  )
}
Posted by: Guest on August-30-2021

Code answers related to "Shell/Bash"

Browse Popular Code Answers by Language