Sign in

Handler Type: ProtectPagePageOnAccessDeniedType

ProtectPagePageOnAccessDeniedType<P, Q> = (context: GetServerSidePropsContext<Q>) => Promise<GetServerSidePropsResult<P>> | GetServerSidePropsResult<P>

Handler invoked when no valid session exists while running a Pages Router getServerSideProps protected by protectPage().

Type Parameters

Type ParameterDescription
PProps returned from getServerSideProps.
Q extends ParsedUrlQueryQuery parameters parsed from the URL.

Parameters

ParameterTypeDescription
contextGetServerSidePropsContext<Q>The Next.js getServerSideProps context.

Returns

Promise<GetServerSidePropsResult<P>> | GetServerSidePropsResult<P>

A getServerSideProps result.

© 2024 MonoCloud. All rights reserved.