GetServerSidePropsResultWithSession<P>: GetServerSidePropsResult<P & {
    user: Claims;
}>

If you wrap your getServerSideProps with WithPageAuthRequired your props object will be augmented with the user property, which will be the user's Claims.

// pages/profile.js
import { withPageAuthRequired } from '@auth0/nextjs-auth0';

export default function Profile({ user }) {
return <div>Hello {user.name}</div>;
}

export const getServerSideProps = withPageAuthRequired();

Type Parameters

  • P = any