Skip to content

Fix and Improve withPageAuthRequired Documentation (signed) #2158

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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 24 commits into from
Jun 10, 2025
Merged

Conversation

tusharpandey13
Copy link
Contributor

@tusharpandey13 tusharpandey13 commented Jun 10, 2025

This is a copy of #1750
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 and others added 23 commits June 10, 2025 17:44
Co-authored-by: Filip Skokan <[email protected]>
Co-authored-by: Tushar Pandey <[email protected]>
Co-authored-by: Tushar Pandey <[email protected]>
@tusharpandey13 tusharpandey13 requested a review from a team as a code owner June 10, 2025 12:17
@tusharpandey13 tusharpandey13 changed the base branch from main to v3 June 10, 2025 12:18
@tusharpandey13 tusharpandey13 merged commit ca2f398 into v3 Jun 10, 2025
7 of 8 checks passed
@tusharpandey13 tusharpandey13 deleted the pr-1750 branch June 10, 2025 12:38
@tusharpandey13 tusharpandey13 changed the title pr 1750 Fix and Improve withPageAuthRequired Documentation (signed) Jun 10, 2025
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.

9 participants