Skip to content

Commit

Permalink
Update EXAMPLES.md (#1320)
Browse files Browse the repository at this point in the history
  • Loading branch information
adamjmcgrath authored Jul 27, 2023
2 parents 1e60144 + 3569868 commit dc89314
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions EXAMPLES.md
Original file line number Diff line number Diff line change
Expand Up @@ -176,9 +176,10 @@ Requests to `/pages/profile` without a valid session cookie will be redirected t

```jsx
// app/profile/page.js
import { withPageAuthRequired } from '@auth0/nextjs-auth0';
import { withPageAuthRequired, getSession } from '@auth0/nextjs-auth0';

export default withPageAuthRequired(function Profile({ user }) {
export default withPageAuthRequired(async function Profile() {
const { user } = await getSession();
return <div>Hello {user.name}</div>;
}, { returnTo: '/profile' })
// You need to provide a `returnTo` since Server Components aren't aware of the page's URL
Expand Down

0 comments on commit dc89314

Please sign in to comment.