How to use the next-auth/client.useSession function in next-auth

To help you get started, we’ve selected a few next-auth examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github hashicorp / boundary / website / components / auth-indicator / index.jsx View on Github external
export default function AuthIndicator() {
  const [session, loading] = useSession()
  if (loading) return `Loading...`
  return (
    <div>
      {session &amp;&amp; (
        &lt;&gt;
          <span>
            Signed in as {session.user.email}
          </span>
          <span>
            <button size="small" title="{`Sign">
          </button></span></div>