From 5ef6a7b59e5e1a4fd37fff52ed0d49941060a340 Mon Sep 17 00:00:00 2001 From: Rita Zerrizuela Date: Thu, 7 Oct 2021 11:54:11 -0300 Subject: [PATCH] Fix #309 (#512) --- src/helpers/with-page-auth-required.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/helpers/with-page-auth-required.ts b/src/helpers/with-page-auth-required.ts index e9dfd161c..926f5a626 100644 --- a/src/helpers/with-page-auth-required.ts +++ b/src/helpers/with-page-auth-required.ts @@ -25,17 +25,14 @@ import { withPageAuthRequired as withPageAuthRequiredCSR } from '../frontend'; * * @category Server */ -export type GetServerSidePropsResultWithSession = GetServerSidePropsResult<{ - user?: Claims | null; - [key: string]: any; -}>; +export type GetServerSidePropsResultWithSession

= GetServerSidePropsResult

; /** * A page route that has been augmented with {@link WithPageAuthRequired} * * @category Server */ -export type PageRoute = (cts: GetServerSidePropsContext) => Promise; +export type PageRoute

= (cts: GetServerSidePropsContext) => Promise>; /** * If you have a custom returnTo url you should specify it in `returnTo`. @@ -63,7 +60,10 @@ export type PageRoute = (cts: GetServerSidePropsContext) => Promise = { + getServerSideProps?: GetServerSideProps

; + returnTo?: string; +}; /** * Wrap your `getServerSideProps` with this method to make sure the user is authenticated before visiting the page. @@ -85,7 +85,7 @@ export type WithPageAuthRequiredOptions = { getServerSideProps?: GetServerSidePr * @category Server */ export type WithPageAuthRequired = { - (opts?: WithPageAuthRequiredOptions): PageRoute; +

(opts?: WithPageAuthRequiredOptions

): PageRoute

;

( Component: ComponentType

, options?: WithPageAuthRequiredCSROptions