Skip to content

Fix and Improve withPageAuthRequired Documentation #1750

Closed
alist wants to merge 4 commits into
auth0:v3from
alist:patch-1
Closed

Fix and Improve withPageAuthRequired Documentation #1750
alist wants to merge 4 commits into
auth0:v3from
alist:patch-1

Conversation

@alist

@alist alist commented May 20, 2024

Copy link
Copy Markdown

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

alist commented May 20, 2024

Copy link
Copy Markdown
Author

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

@alist

alist commented May 20, 2024

Copy link
Copy Markdown
Author

Ok this is verified to work now

@branlok

branlok commented Sep 3, 2024

Copy link
Copy Markdown

This was helpful, thanks.

@tusharpandey13
tusharpandey13 changed the base branch from main to v3 June 6, 2025 08:35
@tusharpandey13
tusharpandey13 requested a review from a team as a code owner June 6, 2025 08:35
@tusharpandey13
tusharpandey13 enabled auto-merge (squash) June 9, 2025 04:23
@tusharpandey13

Copy link
Copy Markdown
Contributor

This change was merged in a duplicate PR #2158 that has all the workflows enabled. Closing this.

auto-merge was automatically disabled June 11, 2025 03:56

Pull request was closed

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.

3 participants