Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix and Improve withPageAuthRequired Documentation #1750

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

alist
Copy link

@alist alist commented May 20, 2024

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
Copy link
Author

alist commented May 20, 2024

Sorry wait my fix doesn't work, it's getting 404 despite now compiling.

@alist
Copy link
Author

alist commented May 20, 2024

Ok this is verified to work now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant