Skip to content

Commit

Permalink
docs(client): onUnauthenticated reference (#5340)
Browse files Browse the repository at this point in the history
  • Loading branch information
stphnnnn committed Sep 14, 2022
1 parent 658b22d commit d2b877f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/docs/getting-started/client.md
Expand Up @@ -67,7 +67,7 @@ export default function Component() {

Due to the way how Next.js handles `getServerSideProps` and `getInitialProps`, every protected page load has to make a server-side request to check if the session is valid and then generate the requested page (SSR). This increases server load, and if you are good with making the requests from the client, there is an alternative. You can use `useSession` in a way that makes sure you always have a valid session. If after the initial loading state there was no session found, you can define the appropriate action to respond.

The default behavior is to redirect the user to the sign-in page, from where - after a successful login - they will be sent back to the page they started on. You can also define an `onFail()` callback, if you would like to do something else:
The default behavior is to redirect the user to the sign-in page, from where - after a successful login - they will be sent back to the page they started on. You can also define an `onUnauthenticated()` callback, if you would like to do something else:

#### Example

Expand Down

1 comment on commit d2b877f

@vercel
Copy link

@vercel vercel bot commented on d2b877f Sep 14, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.