nextjs-auth0
nextjs-auth0 copied to clipboard
Fix and Improve withPageAuthRequired Documentation
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:
- Fixed a typo in the withPageAuthRequired code example. By moving the function keyword inside the withPageAuthRequired call.
- Updated code example to use AppRouterPageRouteOpts for better TypeScript support.
- Added type assertions for params to prevent type errors.
- Have to do separate function declaration and export
Reference: Link to updated documentation page