Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

session undefined nextauth

// pages/index.js
import {getSession} from "next-auth/client"
...
export async function getServerSideProps(ctx) {
  const session = await getSession(ctx)
  return ({props: {session}})
}
...
 
PREVIOUS NEXT
Tagged: #session #undefined #nextauth
ADD COMMENT
Topic
Name
1+6 =