Nextjs app using @auth0/auth0-react with perPageLayout and withAuthenticationRequired hook

Please include the following information in your post:

  • Which SDK this is regarding: @auth0/auth0-react
  • SDK Version: “^1.9.0”
  • Platform Version: next “^12.1.5” , react: “17.0.2”
  • Code Snippets/Error Messages/Supporting Details/Screenshots:

When trying to secure a nextjs page using withAuthenticationRequired from the auth0-react sdk as per shown in the example (auth0-react/EXAMPLES.md at master · auth0/auth0-react · GitHub) and using the feature from next js “perpage layout” (Basic Features: Layouts | Next.js), theres no way to chain both functions to protect a route.