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
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
321a4ad
with-page-auth-required.ts is incompatible with next14 app router
alist May 20, 2024
e32e903
adds correct export
alist May 20, 2024
56d9a4c
Update codeowner file with new GitHub team name
stevenwong-okta Jul 25, 2024
2bb66ee
ci: changed pull_request_target to pull_request and removed the autho…
desusai7 Sep 12, 2024
ddf3fd7
added RL workflow (#1787)
tusharpandey13 Oct 31, 2024
d1e4151
build(deps): bump jshttp/cookie from 0.6.0 to 0.7.1
klobucar Oct 5, 2024
777129d
Add a note to the current readme to point towards our v4 branch for N…
Sambego Dec 2, 2024
5a9a06a
bump version to v3.6.0
tusharpandey13 Jan 31, 2025
392d5d9
update changelog
tusharpandey13 Jan 31, 2025
88f04d3
updated docs
tusharpandey13 Jan 31, 2025
63ea1bf
skip coverage for V3
tusharpandey13 Jan 31, 2025
e9e1517
Enforce nextjs peerDependency to 13.5.9, 14.2.25 and 15.2.3
frederikprijck Mar 23, 2025
ca47208
Include v12.3.2
frederikprijck Mar 23, 2025
0c18407
Update peerDependency for v12 to v12.3.5
frederikprijck Mar 23, 2025
a778a8a
Update JSDocs to mention idpLogout defaults to true
frederikprijck May 9, 2025
c756348
Release v3.7.0
frederikprijck Mar 24, 2025
e1f9abe
Update Release workflow to use v3 tag
frederikprijck Mar 24, 2025
965cc70
Add storeIDToken to config params docs
arpit-jn May 16, 2025
87a92c7
Update useUser example to use a tag instead of Link
frederikprijck May 12, 2025
f0292ec
Upgrade jose and openid-client to fix security vulnerabilities (#2104)
arpit-jn May 16, 2025
bc08a13
refactor: use a single client assertion audience (#2024)
frederikprijck May 21, 2025
d2297ba
Release v3.8.0 (#2148)
tusharpandey13 Jun 4, 2025
c3b281e
1771 - Set id_token_hint when logging out (Signed) (#2151)
tusharpandey13 Jun 10, 2025
27fed8d
Merge branch 'v3' into pr-1750
tusharpandey13 Jun 10, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 13 additions & 6 deletions src/helpers/with-page-auth-required.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,11 @@ export type WithPageAuthRequiredAppRouterOptions = {
* // app/protected-page/page.js
* import { withPageAuthRequired } from '@auth0/nextjs-auth0';
*
* export default function withPageAuthRequired(ProtectedPage() {
* const ProtectedPage = withPageAuthRequired(async function ProtectedPage() {
* return <div>Protected content</div>;
* }, { returnTo: '/protected-page' });
*
* export default ProtectedPage;
* ```
*
* If the user visits `/protected-page` without a valid session, it will redirect the user to the
Expand All @@ -153,15 +155,20 @@ export type WithPageAuthRequiredAppRouterOptions = {
*
* ```js
* // app/protected-page/[slug]/page.js
* import { withPageAuthRequired } from '@auth0/nextjs-auth0';
*
* export default function withPageAuthRequired(ProtectedPage() {
* return <div>Protected content</div>;
* import { AppRouterPageRouteOpts, withPageAuthRequired } from '@auth0/nextjs-auth0';
*
* const ProtectedPage = withPageAuthRequired(async function ProtectedPage({
* params, searchParams
* }: AppRouterPageRouteOpts) {
* const slug = params?.slug as string;
* return <div>Protected content for {slug}</div>;
* }, {
* returnTo({ params }) {
* return `/protected-page/${params.slug}`
* return `/protected-page/${params?.slug}`;
* }
* });
*
* export default ProtectedPage;
* ```
*
* @category Server
Expand Down
Loading