// pages/index.js import {getSession} from "next-auth/client" ... export async function getServerSideProps(ctx) { const session = await getSession(ctx) return ({props: {session}}) } ...