From d6c26b0ba520f6e79a6a16c0c6de0a98062a34db Mon Sep 17 00:00:00 2001 From: Michael Nardolillo Date: Mon, 12 Jul 2021 01:28:39 +0200 Subject: [PATCH] docs: clarify page protection (#2355) --- www/docs/getting-started/client.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/www/docs/getting-started/client.md b/www/docs/getting-started/client.md index dbfb2797fb..160ed69ea8 100644 --- a/www/docs/getting-started/client.md +++ b/www/docs/getting-started/client.md @@ -360,7 +360,7 @@ export default function App({ If you pass the `session` page prop to the `` – as in the example above – you can avoid checking the session twice on pages that support both server and client side rendering. -This only works on pages where you provide the correct `pageProps`, however. This is normally done in `getInitialProps` or `getServerSideProps` like so: +This only works on pages where you provide the correct `pageProps`, however. This is normally done in `getInitialProps` or `getServerSideProps` on an individual page basis like so: ```js title="pages/index.js" import { getSession } from "next-auth/react" @@ -376,7 +376,7 @@ export async function getServerSideProps(ctx) { } ``` -If every one of your pages needs to be protected, you can do this in `_app`, otherwise you can do it on a page-by-page basis. Alternatively, you can do per page authentication checks client side, instead of having each authentication check be blocking (SSR) by using the method described below in [alternative client session handling](#custom-client-session-handling). +If every one of your pages needs to be protected, you can do this in `getInitialProps` in `_app`, otherwise you can do it on a page-by-page basis. Alternatively, you can do per page authentication checks client side, instead of having each authentication check be blocking (SSR) by using the method described below in [alternative client session handling](#custom-client-session-handling). ### Options