nextjs-auth0 icon indicating copy to clipboard operation
nextjs-auth0 copied to clipboard

Fix and Improve withPageAuthRequired Documentation

Open alist opened this issue 9 months ago • 3 comments

with-page-auth-required.ts was incompatible with next14 app router.

📋 Changes

Description: This PR fixes a typo and updates the code examples for withPageAuthRequired in the documentation. The changes ensure compatibility with Next.js 14 and TypeScript by using the AppRouterPageRouteOpts type for parameters. Additionally, the function keyword is moved inside the withPageAuthRequired call for clarity and better readability.

Changes:

  1. Fixed a typo in the withPageAuthRequired code example. By moving the function keyword inside the withPageAuthRequired call.
  2. Updated code example to use AppRouterPageRouteOpts for better TypeScript support.
  3. Added type assertions for params to prevent type errors.
  4. Have to do separate function declaration and export

Reference: Link to updated documentation page

📎 References

🎯 Testing

alist avatar May 20 '24 20:05 alist