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.

Hey there!

As this topic is related to Rules - Hooks - Actions and Rules & Hooks are being deprecated soon I’m excited to let you know about our next Ask me Anything session in the Forum on Thursday, January 18 with the Rules, Hooks and Actions team on Rules & Hooks and why Actions matter! Submit your questions in the thread above and our esteemed product experts will provide written answers on January 18. Find out more about Rules & Hooks and why Actions matter! Can’t wait to see you there!

Learn more here!