From 321a4ade82b3a6953136b2fe707461c81b81a8d9 Mon Sep 17 00:00:00 2001 From: Alexander Hoekje List Date: Mon, 20 May 2024 13:09:06 -0700 Subject: [PATCH 01/23] with-page-auth-required.ts is incompatible with next14 app router --- src/helpers/with-page-auth-required.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/helpers/with-page-auth-required.ts b/src/helpers/with-page-auth-required.ts index e356bacf3..a9367e117 100644 --- a/src/helpers/with-page-auth-required.ts +++ b/src/helpers/with-page-auth-required.ts @@ -136,7 +136,7 @@ export type WithPageAuthRequiredAppRouterOptions = { * // app/protected-page/page.js * import { withPageAuthRequired } from '@auth0/nextjs-auth0'; * - * export default function withPageAuthRequired(ProtectedPage() { + * export default withPageAuthRequired(async function ProtectedPage() { * return
Protected content
; * }, { returnTo: '/protected-page' }); * ``` @@ -153,13 +153,15 @@ export type WithPageAuthRequiredAppRouterOptions = { * * ```js * // app/protected-page/[slug]/page.js - * import { withPageAuthRequired } from '@auth0/nextjs-auth0'; + * import { AppRouterPageRouteOpts, withPageAuthRequired } from '@auth0/nextjs-auth0'; * - * export default function withPageAuthRequired(ProtectedPage() { + * export default withPageAuthRequired(async function ProtectedPage({ + * params, searchParams + * }: AppRouterPageRouteOpts) { * return
Protected content
; * }, { * returnTo({ params }) { - * return `/protected-page/${params.slug}` + * return `/protected-page/${params?.slug}`; * } * }); * ``` From e32e90379fb39b2f6b1cb2f26b033e52560ab674 Mon Sep 17 00:00:00 2001 From: Alexander Hoekje List Date: Mon, 20 May 2024 13:27:04 -0700 Subject: [PATCH 02/23] adds correct export --- src/helpers/with-page-auth-required.ts | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/helpers/with-page-auth-required.ts b/src/helpers/with-page-auth-required.ts index a9367e117..7ef588548 100644 --- a/src/helpers/with-page-auth-required.ts +++ b/src/helpers/with-page-auth-required.ts @@ -136,9 +136,11 @@ export type WithPageAuthRequiredAppRouterOptions = { * // app/protected-page/page.js * import { withPageAuthRequired } from '@auth0/nextjs-auth0'; * - * export default withPageAuthRequired(async function ProtectedPage() { + * const ProtectedPage = withPageAuthRequired(async function ProtectedPage() { * return
Protected content
; * }, { returnTo: '/protected-page' }); + * + * export default ProtectedPage; * ``` * * If the user visits `/protected-page` without a valid session, it will redirect the user to the @@ -154,16 +156,19 @@ export type WithPageAuthRequiredAppRouterOptions = { * ```js * // app/protected-page/[slug]/page.js * import { AppRouterPageRouteOpts, withPageAuthRequired } from '@auth0/nextjs-auth0'; - * - * export default withPageAuthRequired(async function ProtectedPage({ + * + * const ProtectedPage = withPageAuthRequired(async function ProtectedPage({ * params, searchParams * }: AppRouterPageRouteOpts) { - * return
Protected content
; + * const slug = params?.slug as string; + * return
Protected content for {slug}
; * }, { * returnTo({ params }) { * return `/protected-page/${params?.slug}`; * } * }); + * + * export default ProtectedPage; * ``` * * @category Server From 56d9a4c4870ad7ddff9534906f651bb8c1dc644d Mon Sep 17 00:00:00 2001 From: Steven Wong Date: Thu, 25 Jul 2024 22:25:18 +0800 Subject: [PATCH 03/23] Update codeowner file with new GitHub team name --- .github/CODEOWNERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 60f116c05..7958e8bdd 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1 +1 @@ -* @auth0/dx-sdks-engineer +* @auth0/project-dx-sdks-engineer-codeowner From 2bb66ee3f79e29e5a25b8ba646c4baccc274583f Mon Sep 17 00:00:00 2001 From: Desu Sai Venkat <48179357+desusai7@users.noreply.github.com> Date: Thu, 12 Sep 2024 15:12:38 +0530 Subject: [PATCH 04/23] ci: changed pull_request_target to pull_request and removed the authorize step (#1774) --- .github/workflows/browserstack.yml | 10 +--------- .github/workflows/semgrep.yml | 9 +-------- .github/workflows/snyk.yml | 9 +-------- 3 files changed, 3 insertions(+), 25 deletions(-) diff --git a/.github/workflows/browserstack.yml b/.github/workflows/browserstack.yml index b6808a6d1..11d4b55bc 100644 --- a/.github/workflows/browserstack.yml +++ b/.github/workflows/browserstack.yml @@ -3,7 +3,7 @@ name: Browserstack on: merge_group: workflow_dispatch: - pull_request_target: + pull_request: types: - opened - synchronize @@ -23,15 +23,7 @@ env: CACHE_KEY: '${{ github.event.pull_request.head.sha || github.ref }}-${{ github.run_id }}-${{ github.run_attempt }}' jobs: - authorize: - name: Authorize - environment: ${{ github.actor != 'dependabot[bot]' && github.event_name == 'pull_request_target' && github.event.pull_request.head.repo.full_name != github.repository && 'external' || 'internal' }} - runs-on: ubuntu-latest - steps: - - run: true - browserstack: - needs: authorize # Require approval before running on forked pull requests name: Run Tests runs-on: ubuntu-latest diff --git a/.github/workflows/semgrep.yml b/.github/workflows/semgrep.yml index a3aace780..8ecf94071 100644 --- a/.github/workflows/semgrep.yml +++ b/.github/workflows/semgrep.yml @@ -2,7 +2,7 @@ name: Semgrep on: merge_group: - pull_request_target: + pull_request: types: - opened - synchronize @@ -20,15 +20,8 @@ concurrency: cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} jobs: - authorize: - name: Authorize - environment: ${{ github.actor != 'dependabot[bot]' && github.event_name == 'pull_request_target' && github.event.pull_request.head.repo.full_name != github.repository && 'external' || 'internal' }} - runs-on: ubuntu-latest - steps: - - run: true run: - needs: authorize # Require approval before running on forked pull requests name: Check for Vulnerabilities runs-on: ubuntu-latest diff --git a/.github/workflows/snyk.yml b/.github/workflows/snyk.yml index 0ebacbece..74e00911c 100644 --- a/.github/workflows/snyk.yml +++ b/.github/workflows/snyk.yml @@ -3,7 +3,7 @@ name: Snyk on: merge_group: workflow_dispatch: - pull_request_target: + pull_request: types: - opened - synchronize @@ -21,15 +21,8 @@ concurrency: cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} jobs: - authorize: - name: Authorize - environment: ${{ github.actor != 'dependabot[bot]' && github.event_name == 'pull_request_target' && github.event.pull_request.head.repo.full_name != github.repository && 'external' || 'internal' }} - runs-on: ubuntu-latest - steps: - - run: true check: - needs: authorize name: Check for Vulnerabilities runs-on: ubuntu-latest From ddf3fd7c741a2faca529a81e8825c8f3bb2b170c Mon Sep 17 00:00:00 2001 From: Tushar Pandey Date: Thu, 31 Oct 2024 17:03:01 +0530 Subject: [PATCH 05/23] added RL workflow (#1787) --- .github/actions/rl-scanner/action.yml | 71 +++++++++++++++++++++++++++ .github/workflows/release.yml | 14 ++++++ .github/workflows/rl-secure.yml | 67 +++++++++++++++++++++++++ 3 files changed, 152 insertions(+) create mode 100644 .github/actions/rl-scanner/action.yml create mode 100644 .github/workflows/rl-secure.yml diff --git a/.github/actions/rl-scanner/action.yml b/.github/actions/rl-scanner/action.yml new file mode 100644 index 000000000..eb0171342 --- /dev/null +++ b/.github/actions/rl-scanner/action.yml @@ -0,0 +1,71 @@ +name: 'Reversing Labs Scanner' +description: 'Runs the Reversing Labs scanner on a specified artifact.' +inputs: + artifact-path: + description: 'Path to the artifact to be scanned.' + required: true + version: + description: 'Version of the artifact.' + required: true + +runs: + using: 'composite' + steps: + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: '3.10' + + - name: Install Python dependencies + shell: bash + run: | + pip install boto3 requests + + - name: Configure AWS credentials + uses: aws-actions/configure-aws-credentials@v1 + with: + role-to-assume: ${{ env.PRODSEC_TOOLS_ARN }} + aws-region: us-east-1 + mask-aws-account-id: true + + - name: Install RL Wrapper + shell: bash + run: | + pip install rl-wrapper>=1.0.0 --index-url "https://${{ env.PRODSEC_TOOLS_USER }}:${{ env.PRODSEC_TOOLS_TOKEN }}@a0us.jfrog.io/artifactory/api/pypi/python-local/simple" + + - name: Run RL Scanner + shell: bash + env: + RLSECURE_LICENSE: ${{ env.RLSECURE_LICENSE }} + RLSECURE_SITE_KEY: ${{ env.RLSECURE_SITE_KEY }} + SIGNAL_HANDLER_TOKEN: ${{ env.SIGNAL_HANDLER_TOKEN }} + PYTHONUNBUFFERED: 1 + run: | + if [ ! -f "${{ inputs.artifact-path }}" ]; then + echo "Artifact not found: ${{ inputs.artifact-path }}" + exit 1 + fi + + rl-wrapper \ + --artifact "${{ inputs.artifact-path }}" \ + --name "${{ github.event.repository.name }}" \ + --version "${{ inputs.version }}" \ + --repository "${{ github.repository }}" \ + --commit "${{ github.sha }}" \ + --build-env "github_actions" \ + --suppress_output + + # Check the outcome of the scanner + if [ $? -ne 0 ]; then + echo "RL Scanner failed." + echo "scan-status=failed" >> $GITHUB_ENV + exit 1 + else + echo "RL Scanner passed." + echo "scan-status=success" >> $GITHUB_ENV + fi + +outputs: + scan-status: + description: 'The outcome of the scan process.' + value: ${{ env.scan-status }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e6c8430d1..5daf1e151 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -15,8 +15,22 @@ permissions: ### TODO: Also remove `npm-release` workflow from this repo's .github/workflows folder once the repo is public. jobs: + rl-scanner: + uses: ./.github/workflows/rl-secure.yml + with: + node-version: 18 ## depends if build requires node else we can remove this. + artifact-name: 'nextjs-auth0.tgz' ## Will change respective to Repository + secrets: + RLSECURE_LICENSE: ${{ secrets.RLSECURE_LICENSE }} + RLSECURE_SITE_KEY: ${{ secrets.RLSECURE_SITE_KEY }} + SIGNAL_HANDLER_TOKEN: ${{ secrets.SIGNAL_HANDLER_TOKEN }} + PRODSEC_TOOLS_USER: ${{ secrets.PRODSEC_TOOLS_USER }} + PRODSEC_TOOLS_TOKEN: ${{ secrets.PRODSEC_TOOLS_TOKEN }} + PRODSEC_TOOLS_ARN: ${{ secrets.PRODSEC_TOOLS_ARN }} + release: uses: ./.github/workflows/npm-release.yml + needs: rl-scanner ## this is important as this will not let release job to run until rl-scanner is done with: node-version: 18 require-build: false diff --git a/.github/workflows/rl-secure.yml b/.github/workflows/rl-secure.yml new file mode 100644 index 000000000..96c4efbe4 --- /dev/null +++ b/.github/workflows/rl-secure.yml @@ -0,0 +1,67 @@ +name: RL-Secure Workflow + +on: + workflow_call: + inputs: + node-version: ## depends if build requires node else we can remove this. + required: true + type: string + artifact-name: + required: true + type: string + secrets: + RLSECURE_LICENSE: + required: true + RLSECURE_SITE_KEY: + required: true + SIGNAL_HANDLER_TOKEN: + required: true + PRODSEC_TOOLS_USER: + required: true + PRODSEC_TOOLS_TOKEN: + required: true + PRODSEC_TOOLS_ARN: + required: true + +jobs: + rl-scanner: + name: Run Reversing Labs Scanner + if: github.event_name == 'workflow_dispatch' || (github.event_name == 'pull_request' && github.event.pull_request.merged && startsWith(github.event.pull_request.head.ref, 'release/')) + runs-on: ubuntu-latest + outputs: + scan-status: ${{ steps.rl-scan-conclusion.outcome }} + + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Build package + uses: ./.github/actions/build + with: + node: ${{ inputs.node-version }} + + - name: Create tgz build artifact + run: | + tar -czvf ${{ inputs.artifact-name }} * + + - id: get_version + uses: ./.github/actions/get-version + + - name: Run RL Scanner + id: rl-scan-conclusion + uses: ./.github/actions/rl-scanner + with: + artifact-path: "$(pwd)/${{ inputs.artifact-name }}" + version: "${{ steps.get_version.outputs.version }}" + env: + RLSECURE_LICENSE: ${{ secrets.RLSECURE_LICENSE }} + RLSECURE_SITE_KEY: ${{ secrets.RLSECURE_SITE_KEY }} + SIGNAL_HANDLER_TOKEN: ${{ secrets.SIGNAL_HANDLER_TOKEN }} + PRODSEC_TOOLS_USER: ${{ secrets.PRODSEC_TOOLS_USER }} + PRODSEC_TOOLS_TOKEN: ${{ secrets.PRODSEC_TOOLS_TOKEN }} + PRODSEC_TOOLS_ARN: ${{ secrets.PRODSEC_TOOLS_ARN }} + + - name: Output scan result + run: echo "scan-status=${{ steps.rl-scan-conclusion.outcome }}" >> $GITHUB_ENV \ No newline at end of file From d1e4151792aa3d845505e53ebd893f2bf71a8987 Mon Sep 17 00:00:00 2001 From: Jonathon Klobucar Date: Fri, 4 Oct 2024 21:12:34 -0700 Subject: [PATCH 06/23] build(deps): bump jshttp/cookie from 0.6.0 to 0.7.1 --- package-lock.json | 15 ++++++++------- package.json | 2 +- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/package-lock.json b/package-lock.json index 58e61ce73..91b4d5fc9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,7 +10,7 @@ "license": "MIT", "dependencies": { "@panva/hkdf": "^1.0.2", - "cookie": "^0.6.0", + "cookie": "^0.7.1", "debug": "^4.3.4", "joi": "^17.6.0", "jose": "^4.9.2", @@ -4787,9 +4787,10 @@ "dev": true }, "node_modules/cookie": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.6.0.tgz", - "integrity": "sha512-U71cyTamuh1CRNCfpGY6to28lxvNwPG4Guz/EVjgf3Jmzv0vlDp1atT9eS5dDjMYHucpHbWns6Lwf3BKz6svdw==", + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.1.tgz", + "integrity": "sha512-6DnInpx7SJ2AK3+CTUE/ZM0vWTUboZCegxhC2xiIydHR9jNuTAASBrfEpHhiGOZw/nX51bHt6YQl8jsGo4y/0w==", + "license": "MIT", "engines": { "node": ">= 0.6" } @@ -18852,9 +18853,9 @@ "dev": true }, "cookie": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.6.0.tgz", - "integrity": "sha512-U71cyTamuh1CRNCfpGY6to28lxvNwPG4Guz/EVjgf3Jmzv0vlDp1atT9eS5dDjMYHucpHbWns6Lwf3BKz6svdw==" + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.1.tgz", + "integrity": "sha512-6DnInpx7SJ2AK3+CTUE/ZM0vWTUboZCegxhC2xiIydHR9jNuTAASBrfEpHhiGOZw/nX51bHt6YQl8jsGo4y/0w==" }, "cookies": { "version": "0.8.0", diff --git a/package.json b/package.json index 24689621c..757d41a6e 100644 --- a/package.json +++ b/package.json @@ -121,7 +121,7 @@ }, "dependencies": { "@panva/hkdf": "^1.0.2", - "cookie": "^0.6.0", + "cookie": "^0.7.1", "debug": "^4.3.4", "joi": "^17.6.0", "jose": "^4.9.2", From 777129d4829ec7fba0bd54c3e48e87670d40a453 Mon Sep 17 00:00:00 2001 From: Sambego Date: Mon, 2 Dec 2024 08:49:16 +0100 Subject: [PATCH 07/23] Add a note to the current readme to point towards our v4 branch for Next v15 support --- README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.md b/README.md index b050fe8ee..a50a32076 100644 --- a/README.md +++ b/README.md @@ -25,6 +25,11 @@ The Auth0 Next.js SDK is a library for implementing user authentication in Next. ### Installation +> [!NOTE] +> #### Looking for Next.js v15 support? +> We're currently hard at work building a new version of this Auth0 SDK that provides support for the latest version of Next.js v15. +> You can find more info and try it out trough the [v4 branch of this repository](https://github.com/auth0/nextjs-auth0/tree/v4). + Using [npm](https://npmjs.org): ```sh From 5a9a06a7230c3c8472a35157636f8ff4f11cef9a Mon Sep 17 00:00:00 2001 From: Tushar Pandey Date: Fri, 31 Jan 2025 16:03:22 +0530 Subject: [PATCH 08/23] bump version to v3.6.0 --- .version | 2 +- package.json | 2 +- src/version.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.version b/.version index 4d0729e54..130165bc0 100644 --- a/.version +++ b/.version @@ -1 +1 @@ -v3.5.0 \ No newline at end of file +v3.6.0 diff --git a/package.json b/package.json index 757d41a6e..3fb2d2c73 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@auth0/nextjs-auth0", - "version": "3.5.0", + "version": "3.6.0", "description": "Next.js SDK for signing in with Auth0", "exports": { ".": "./dist/index.js", diff --git a/src/version.ts b/src/version.ts index 42760aaff..5047ed2cd 100644 --- a/src/version.ts +++ b/src/version.ts @@ -1 +1 @@ -export default '3.5.0'; +export default '3.6.0'; From 392d5d9b7b0900380a443fb73dfc2ed77df5bd6a Mon Sep 17 00:00:00 2001 From: Tushar Pandey Date: Fri, 31 Jan 2025 16:03:34 +0530 Subject: [PATCH 09/23] update changelog --- CHANGELOG.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 174443b50..f03d752ee 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,14 @@ # Change Log +## [v3.6.0](https://github.com/auth0/nextjs-auth0/tree/v3.6.0) (2025-01-31) +This is a maintainance release for V3 of the SDK. +V4 supports Next.JS 15 and React 19 and is published on [npm](https://www.npmjs.com/package/@auth0/nextjs-auth0)! +We will continue to add features and security upgrades in V4 going further. Please migrate to V4 for a better experience. + + +**Security** +- [bump jshttp/cookie from 0.6.0 to 0.7.1](https://github.com/auth0/nextjs-auth0/pull/1778) + ## [v3.5.0](https://github.com/auth0/nextjs-auth0/tree/v3.5.0) (2023-12-06) [Full Changelog](https://github.com/auth0/nextjs-auth0/compare/v3.4.0...v3.5.0) From 88f04d31f5f3dec7b822cf6e31e9543abd482e7d Mon Sep 17 00:00:00 2001 From: Tushar Pandey Date: Fri, 31 Jan 2025 16:04:05 +0530 Subject: [PATCH 10/23] updated docs --- docs/assets/style.css | 11 ++++++++ .../classes/client_use_user.RequestError.html | 4 +-- .../http_auth0_next_api_request.default.html | 4 +-- .../http_auth0_next_api_response.default.html | 4 +-- .../http_auth0_next_request.default.html | 4 +-- ...tp_auth0_next_request_cookies.default.html | 4 +-- .../http_auth0_next_response.default.html | 4 +-- ...p_auth0_next_response_cookies.default.html | 4 +-- docs/classes/session_session.default.html | 16 +++++------ .../utils_errors.AccessTokenError.html | 12 ++++---- docs/classes/utils_errors.AuthError.html | 12 ++++---- .../utils_errors.CallbackHandlerError.html | 12 ++++---- docs/classes/utils_errors.HandlerError.html | 12 ++++---- .../utils_errors.LoginHandlerError.html | 12 ++++---- .../utils_errors.LogoutHandlerError.html | 12 ++++---- .../utils_errors.ProfileHandlerError.html | 12 ++++---- .../utils_errors.AccessTokenErrorCode.html | 4 +-- docs/functions/client_use_user.default.html | 2 +- docs/functions/client_use_user.useUser.html | 4 +-- .../config.configSingletonGetter.html | 2 +- docs/functions/edge.getAccessToken-1.html | 4 +-- docs/functions/edge.getSession-1.html | 4 +-- docs/functions/edge.handleAuth-1.html | 6 ++-- docs/functions/edge.handleCallback-1.html | 2 +- docs/functions/edge.handleLogin-1.html | 2 +- docs/functions/edge.handleLogout-1.html | 2 +- docs/functions/edge.handleProfile-1.html | 2 +- docs/functions/edge.initAuth0-1.html | 4 +-- docs/functions/edge.touchSession-1.html | 4 +-- docs/functions/edge.updateSession-1.html | 4 +-- .../functions/edge.withApiAuthRequired-1.html | 6 ++-- .../edge.withMiddlewareAuthRequired.html | 4 +-- .../edge.withPageAuthRequired-1.html | 6 ++-- .../handlers_router_helpers.getHandler.html | 2 +- ...helpers_testing.generateSessionCookie.html | 2 +- docs/functions/index.getAccessToken-1.html | 4 +-- docs/functions/index.getSession-1.html | 4 +-- docs/functions/index.handleAuth-1.html | 6 ++-- docs/functions/index.handleCallback-1.html | 2 +- docs/functions/index.handleLogin-1.html | 2 +- docs/functions/index.handleLogout-1.html | 2 +- docs/functions/index.handleProfile-1.html | 2 +- docs/functions/index.initAuth0-1.html | 4 +-- docs/functions/index.touchSession-1.html | 4 +-- docs/functions/index.updateSession-1.html | 4 +-- .../index.withApiAuthRequired-1.html | 6 ++-- .../index.withPageAuthRequired-1.html | 6 ++-- docs/functions/init._initAuth.html | 2 +- .../client_use_user.UserProfile.html | 4 +-- ...ent_with_page_auth_required.UserProps.html | 4 +-- ..._required.WithPageAuthRequiredOptions.html | 8 +++--- docs/interfaces/config.NextConfig.html | 4 +-- .../handlers_callback.CallbackOptions.html | 10 +++---- .../handlers_login.AuthorizationParams.html | 12 ++++---- .../handlers_login.LoginOptions.html | 8 +++--- .../handlers_logout.LogoutOptions.html | 6 ++-- ...n_get_access_token.AccessTokenRequest.html | 13 ++++----- ...get_access_token.GetAccessTokenResult.html | 4 +-- docs/interfaces/session_session.Claims.html | 2 +- docs/interfaces/shared.Auth0Server.html | 28 +++++++++---------- docs/modules/client.html | 2 +- docs/modules/client_use_user.html | 2 +- .../client_with_page_auth_required.html | 2 +- docs/modules/config.html | 2 +- docs/modules/edge.html | 2 +- docs/modules/handlers.html | 2 +- docs/modules/handlers_auth.html | 2 +- docs/modules/handlers_backchannel_logout.html | 2 +- docs/modules/handlers_callback.html | 2 +- docs/modules/handlers_login.html | 2 +- docs/modules/handlers_logout.html | 2 +- docs/modules/handlers_profile.html | 2 +- docs/modules/handlers_router_helpers.html | 2 +- docs/modules/helpers.html | 2 +- docs/modules/helpers_testing.html | 2 +- .../helpers_with_api_auth_required.html | 2 +- ...helpers_with_middleware_auth_required.html | 2 +- .../helpers_with_page_auth_required.html | 2 +- docs/modules/http.html | 2 +- docs/modules/http_auth0_next_api_request.html | 2 +- .../modules/http_auth0_next_api_response.html | 2 +- docs/modules/http_auth0_next_request.html | 2 +- .../http_auth0_next_request_cookies.html | 2 +- docs/modules/http_auth0_next_response.html | 2 +- .../http_auth0_next_response_cookies.html | 2 +- docs/modules/index.html | 2 +- docs/modules/init.html | 2 +- docs/modules/session.html | 2 +- docs/modules/session_get_access_token.html | 2 +- docs/modules/session_get_session.html | 2 +- docs/modules/session_session.html | 2 +- docs/modules/session_touch_session.html | 2 +- docs/modules/session_update_session.html | 2 +- docs/modules/shared.html | 2 +- docs/modules/utils_errors.html | 2 +- docs/modules/version.html | 2 +- docs/types/client_use_user.UserContext.html | 2 +- docs/types/client_use_user.UserProvider.html | 2 +- .../client_use_user.UserProviderProps.html | 2 +- ...ge_auth_required.WithPageAuthRequired.html | 2 +- docs/types/config.ConfigParameters.html | 2 +- docs/types/config.GetConfig.html | 2 +- docs/types/edge.InitAuth0.html | 2 +- .../types/handlers_auth.AppRouterOnError.html | 2 +- docs/types/handlers_auth.HandleAuth.html | 4 +-- docs/types/handlers_auth.Handlers.html | 2 +- .../handlers_auth.PageRouterOnError.html | 2 +- ...hannel_logout.HandleBackchannelLogout.html | 2 +- .../handlers_callback.AfterCallback.html | 2 +- ...ndlers_callback.AfterCallbackAppRoute.html | 11 +++----- ...dlers_callback.AfterCallbackPageRoute.html | 11 +++----- .../handlers_callback.CallbackHandler.html | 2 +- ...lers_callback.CallbackOptionsProvider.html | 2 +- .../handlers_callback.HandleCallback.html | 11 +++----- docs/types/handlers_login.GetLoginState.html | 2 +- .../handlers_login.GetLoginStateAppRoute.html | 2 +- ...handlers_login.GetLoginStatePageRoute.html | 2 +- docs/types/handlers_login.HandleLogin.html | 11 +++----- docs/types/handlers_login.LoginHandler.html | 2 +- .../handlers_login.LoginOptionsProvider.html | 2 +- docs/types/handlers_logout.HandleLogout.html | 11 +++----- docs/types/handlers_logout.LogoutHandler.html | 2 +- ...handlers_logout.LogoutOptionsProvider.html | 2 +- docs/types/handlers_profile.AfterRefetch.html | 2 +- ...handlers_profile.AfterRefetchAppRoute.html | 2 +- ...andlers_profile.AfterRefetchPageRoute.html | 2 +- .../types/handlers_profile.HandleProfile.html | 11 +++----- .../handlers_profile.ProfileHandler.html | 2 +- .../handlers_profile.ProfileOptions.html | 2 +- ...ndlers_profile.ProfileOptionsProvider.html | 2 +- ...lers_router_helpers.AppRouteHandlerFn.html | 2 +- ...uter_helpers.AppRouteHandlerFnContext.html | 2 +- ...dlers_router_helpers.AppRouterHandler.html | 2 +- .../handlers_router_helpers.AuthHandler.html | 2 +- .../handlers_router_helpers.Handler.html | 2 +- ...s_router_helpers.NextAppRouterHandler.html | 2 +- ..._router_helpers.NextPageRouterHandler.html | 2 +- ...ndlers_router_helpers.OptionsProvider.html | 2 +- ...ers_router_helpers.PageRouteHandlerFn.html | 2 +- ...lers_router_helpers.PageRouterHandler.html | 2 +- ...s_testing.GenerateSessionCookieConfig.html | 2 +- ...h_api_auth_required.AppRouteHandlerFn.html | 2 +- ...uth_required.AppRouteHandlerFnContext.html | 2 +- ...api_auth_required.WithApiAuthRequired.html | 2 +- ..._required.WithApiAuthRequiredAppRoute.html | 2 +- ...required.WithApiAuthRequiredPageRoute.html | 2 +- ...h_required.WithMiddlewareAuthRequired.html | 2 +- ...red.WithMiddlewareAuthRequiredOptions.html | 2 +- ...page_auth_required.AppRouterPageRoute.html | 2 +- ..._auth_required.AppRouterPageRouteOpts.html | 2 +- ...d.GetServerSidePropsResultWithSession.html | 2 +- ...ers_with_page_auth_required.PageRoute.html | 2 +- ...ge_auth_required.WithPageAuthRequired.html | 2 +- ...equired.WithPageAuthRequiredAppRouter.html | 2 +- ....WithPageAuthRequiredAppRouterOptions.html | 2 +- ...quired.WithPageAuthRequiredPageRouter.html | 2 +- ...WithPageAuthRequiredPageRouterOptions.html | 2 +- docs/types/index.Auth0Server.html | 2 +- docs/types/index.InitAuth0.html | 2 +- docs/types/init.InitAuth0.html | 2 +- ...session_get_access_token.AfterRefresh.html | 2 +- ...get_access_token.AfterRefreshAppRoute.html | 2 +- ...et_access_token.AfterRefreshPageRoute.html | 2 +- ...ssion_get_access_token.GetAccessToken.html | 2 +- .../types/session_get_session.GetSession.html | 2 +- .../session_touch_session.TouchSession.html | 2 +- .../session_update_session.UpdateSession.html | 2 +- docs/types/shared.SessionStore.html | 2 +- docs/types/shared.SessionStorePayload.html | 2 +- docs/variables/shared.telemetry.html | 2 +- docs/variables/version.default.html | 2 +- 171 files changed, 313 insertions(+), 321 deletions(-) diff --git a/docs/assets/style.css b/docs/assets/style.css index 108428c3f..07a385b73 100644 --- a/docs/assets/style.css +++ b/docs/assets/style.css @@ -11,6 +11,7 @@ --light-color-text-aside: #6e6e6e; --light-color-link: #1f70c2; + --light-color-ts-keyword: #056bd6; --light-color-ts-project: #b111c9; --light-color-ts-module: var(--light-color-ts-project); --light-color-ts-namespace: var(--light-color-ts-project); @@ -50,6 +51,7 @@ --dark-color-text-aside: #dddddd; --dark-color-link: #00aff4; + --dark-color-ts-keyword: #3399ff; --dark-color-ts-project: #e358ff; --dark-color-ts-module: var(--dark-color-ts-project); --dark-color-ts-namespace: var(--dark-color-ts-project); @@ -91,6 +93,7 @@ --color-text-aside: var(--light-color-text-aside); --color-link: var(--light-color-link); + --color-ts-keyword: var(--light-color-ts-keyword); --color-ts-module: var(--light-color-ts-module); --color-ts-namespace: var(--light-color-ts-namespace); --color-ts-enum: var(--light-color-ts-enum); @@ -132,6 +135,7 @@ --color-text-aside: var(--dark-color-text-aside); --color-link: var(--dark-color-link); + --color-ts-keyword: var(--dark-color-ts-keyword); --color-ts-module: var(--dark-color-ts-module); --color-ts-namespace: var(--dark-color-ts-namespace); --color-ts-enum: var(--dark-color-ts-enum); @@ -180,6 +184,7 @@ body { --color-text-aside: var(--light-color-text-aside); --color-link: var(--light-color-link); + --color-ts-keyword: var(--light-color-ts-keyword); --color-ts-module: var(--light-color-ts-module); --color-ts-namespace: var(--light-color-ts-namespace); --color-ts-enum: var(--light-color-ts-enum); @@ -219,6 +224,7 @@ body { --color-text-aside: var(--dark-color-text-aside); --color-link: var(--dark-color-link); + --color-ts-keyword: var(--dark-color-ts-keyword); --color-ts-module: var(--dark-color-ts-module); --color-ts-namespace: var(--dark-color-ts-namespace); --color-ts-enum: var(--dark-color-ts-enum); @@ -984,6 +990,11 @@ a.tsd-index-link { overflow-x: auto; } +.tsd-signature-keyword { + color: var(--color-ts-keyword); + font-weight: normal; +} + .tsd-signature-symbol { color: var(--color-text-aside); font-weight: normal; diff --git a/docs/classes/client_use_user.RequestError.html b/docs/classes/client_use_user.RequestError.html index 15042714d..1ba3de007 100644 --- a/docs/classes/client_use_user.RequestError.html +++ b/docs/classes/client_use_user.RequestError.html @@ -3,6 +3,6 @@ fails, for example due to being offline.

This error is not thrown when the status code of the response is 204, because that means the user is not authenticated.

-

Hierarchy

  • Error
    • RequestError

Constructors

Hierarchy

  • Error
    • RequestError

Constructors

Properties

Constructors

Properties

status: number
\ No newline at end of file +

Constructors

Properties

status: number
\ No newline at end of file diff --git a/docs/classes/http_auth0_next_api_request.default.html b/docs/classes/http_auth0_next_api_request.default.html index 2dc00e74a..04f9a4b16 100644 --- a/docs/classes/http_auth0_next_api_request.default.html +++ b/docs/classes/http_auth0_next_api_request.default.html @@ -1,6 +1,6 @@ -default | @auth0/nextjs-auth0

Hierarchy

  • default<NextApiRequest>
    • default

Constructors

constructor +default | @auth0/nextjs-auth0

Hierarchy

  • default<NextApiRequest>
    • default

Constructors

Methods

\ No newline at end of file +

Constructors

Methods

\ No newline at end of file diff --git a/docs/classes/http_auth0_next_api_response.default.html b/docs/classes/http_auth0_next_api_response.default.html index c788f0e88..abc349b1e 100644 --- a/docs/classes/http_auth0_next_api_response.default.html +++ b/docs/classes/http_auth0_next_api_response.default.html @@ -1,3 +1,3 @@ -default | @auth0/nextjs-auth0

Hierarchy

  • default<NextApiResponse>
    • default

Constructors

constructor +default | @auth0/nextjs-auth0

Hierarchy

  • default<NextApiResponse>
    • default

Constructors

Methods

Constructors

Methods

  • Parameters

    • location: string
    • status: number = 302

    Returns void

\ No newline at end of file +

Constructors

Methods

  • Parameters

    • location: string
    • status: number = 302

    Returns void

\ No newline at end of file diff --git a/docs/classes/http_auth0_next_request.default.html b/docs/classes/http_auth0_next_request.default.html index 03eb13bc4..265c6f318 100644 --- a/docs/classes/http_auth0_next_request.default.html +++ b/docs/classes/http_auth0_next_request.default.html @@ -1,6 +1,6 @@ -default | @auth0/nextjs-auth0

Hierarchy

  • default<NextRequest>
    • default

Constructors

constructor +default | @auth0/nextjs-auth0

Hierarchy

  • default<NextRequest>
    • default

Constructors

Methods

  • Returns Promise<string | Record<string, string>>

\ No newline at end of file +

Constructors

Methods

  • Returns Promise<string | Record<string, string>>

\ No newline at end of file diff --git a/docs/classes/http_auth0_next_request_cookies.default.html b/docs/classes/http_auth0_next_request_cookies.default.html index 5f605ef01..71c75ce77 100644 --- a/docs/classes/http_auth0_next_request_cookies.default.html +++ b/docs/classes/http_auth0_next_request_cookies.default.html @@ -1,3 +1,3 @@ -default | @auth0/nextjs-auth0

Hierarchy

  • default
    • default

Constructors

constructor +default | @auth0/nextjs-auth0
\ No newline at end of file +

Constructors

Methods

\ No newline at end of file diff --git a/docs/classes/http_auth0_next_response.default.html b/docs/classes/http_auth0_next_response.default.html index f9566cc51..eef48973c 100644 --- a/docs/classes/http_auth0_next_response.default.html +++ b/docs/classes/http_auth0_next_response.default.html @@ -1,7 +1,7 @@ -default | @auth0/nextjs-auth0

Hierarchy

  • default<NextResponse>
    • default

Constructors

constructor +default | @auth0/nextjs-auth0

Hierarchy

  • default<NextResponse>
    • default

Constructors

Methods

  • Parameters

    • name: string
    • Optional options: CookieSerializeOptions

    Returns void

  • Parameters

    • location: string
    • status: number = 302

    Returns void

  • Parameters

    • name: string
    • value: string
    • Optional options: CookieSerializeOptions

    Returns void

\ No newline at end of file +

Constructors

Methods

  • Parameters

    • name: string
    • Optional options: CookieSerializeOptions

    Returns void

  • Parameters

    • location: string
    • status: number = 302

    Returns void

  • Parameters

    • name: string
    • value: string
    • Optional options: CookieSerializeOptions

    Returns void

\ No newline at end of file diff --git a/docs/classes/http_auth0_next_response_cookies.default.html b/docs/classes/http_auth0_next_response_cookies.default.html index 2fb4be43c..74e7b9f50 100644 --- a/docs/classes/http_auth0_next_response_cookies.default.html +++ b/docs/classes/http_auth0_next_response_cookies.default.html @@ -1,4 +1,4 @@ -default | @auth0/nextjs-auth0

Hierarchy

  • default
    • default

Constructors

constructor +default | @auth0/nextjs-auth0

Hierarchy

  • default
    • default

Constructors

Methods

Constructors

Methods

  • Parameters

    • name: string
    • Optional options: CookieSerializeOptions

    Returns void

  • Parameters

    • name: string
    • value: string
    • Optional options: CookieSerializeOptions

    Returns void

\ No newline at end of file +

Constructors

Methods

  • Parameters

    • name: string
    • Optional options: CookieSerializeOptions

    Returns void

  • Parameters

    • name: string
    • value: string
    • Optional options: CookieSerializeOptions

    Returns void

\ No newline at end of file diff --git a/docs/classes/session_session.default.html b/docs/classes/session_session.default.html index cdae66445..b9054cb2c 100644 --- a/docs/classes/session_session.default.html +++ b/docs/classes/session_session.default.html @@ -1,17 +1,17 @@ default | @auth0/nextjs-auth0

The user's session.

-

Hierarchy

  • default

Indexable

[key: string]: any

Constructors

Indexable

[key: string]: any

Constructors

Properties

accessToken?: string

The access token.

-
accessTokenExpiresAt?: number

The expiration of the access token.

-
accessTokenScope?: string

The access token scopes.

-
idToken?: string

The ID token.

-
refreshToken?: string

The refresh token, which is used to request a new access token.

+

Constructors

Properties

accessToken?: string

The access token.

+
accessTokenExpiresAt?: number

The expiration of the access token.

+
accessTokenScope?: string

The access token scopes.

+
idToken?: string

The ID token.

+
refreshToken?: string

The refresh token, which is used to request a new access token.

IMPORTANT You need to request the offline_access scope on login to get a refresh token from Auth0.

-
user: Claims

Any of the claims from the id_token.

-
\ No newline at end of file +
user: Claims

Any of the claims from the id_token.

+
\ No newline at end of file diff --git a/docs/classes/utils_errors.AccessTokenError.html b/docs/classes/utils_errors.AccessTokenError.html index 5e74eb59e..2f06f6537 100644 --- a/docs/classes/utils_errors.AccessTokenError.html +++ b/docs/classes/utils_errors.AccessTokenError.html @@ -6,20 +6,20 @@ parse or otherwise rely on the error message to handle errors.
  • AccessTokenErrorCode for the list of all possible error codes.
  • -

    Hierarchy

    Constructors

    Hierarchy

    Constructors

    Properties

    Constructors

    Properties

    cause?: Error

    The underlying error, if any.

    +

    Constructors

    Properties

    cause?: Error

    The underlying error, if any.

    IMPORTANT When this error is from the Identity Provider (IdentityProviderError) it can contain user input and is only escaped using basic escaping for putting untrusted data directly into the HTML body.

    You should not render this error without using a templating engine that will properly escape it for other HTML contexts first.

    -
    code: string

    A machine-readable error code that remains stable within a major version of the SDK. You +

    code: string

    A machine-readable error code that remains stable within a major version of the SDK. You should rely on this error code to handle errors. In contrast, the error message is not part of the API and can change anytime. Do not parse or otherwise rely on the error message to handle errors.

    -
    name: string

    The error class name.

    -
    status?: number

    The HTTP status code, if any.

    -
    \ No newline at end of file +
    name: string

    The error class name.

    +
    status?: number

    The HTTP status code, if any.

    +
    \ No newline at end of file diff --git a/docs/classes/utils_errors.AuthError.html b/docs/classes/utils_errors.AuthError.html index 86180b7eb..a552d1319 100644 --- a/docs/classes/utils_errors.AuthError.html +++ b/docs/classes/utils_errors.AuthError.html @@ -5,20 +5,20 @@ without using a templating engine that will properly escape it for other HTML contexts first.

    Note that the error message of the underlying error is not escaped in any way, so do not render it without escaping it first!

    -

    Hierarchy

    Constructors

    Hierarchy

    Constructors

    Properties

    Constructors

    Properties

    cause?: Error

    The underlying error, if any.

    +

    Constructors

    Properties

    cause?: Error

    The underlying error, if any.

    IMPORTANT When this error is from the Identity Provider (IdentityProviderError) it can contain user input and is only escaped using basic escaping for putting untrusted data directly into the HTML body.

    You should not render this error without using a templating engine that will properly escape it for other HTML contexts first.

    -
    code: string

    A machine-readable error code that remains stable within a major version of the SDK. You +

    code: string

    A machine-readable error code that remains stable within a major version of the SDK. You should rely on this error code to handle errors. In contrast, the error message is not part of the API and can change anytime. Do not parse or otherwise rely on the error message to handle errors.

    -
    name: string

    The error class name.

    -
    status?: number

    The HTTP status code, if any.

    -
    \ No newline at end of file +
    name: string

    The error class name.

    +
    status?: number

    The HTTP status code, if any.

    +
    \ No newline at end of file diff --git a/docs/classes/utils_errors.CallbackHandlerError.html b/docs/classes/utils_errors.CallbackHandlerError.html index 8fbae3e37..f08c08c13 100644 --- a/docs/classes/utils_errors.CallbackHandlerError.html +++ b/docs/classes/utils_errors.CallbackHandlerError.html @@ -12,21 +12,21 @@
  • the status property contains the HTTP status code of the error, if any.
  • -

    Hierarchy

    Constructors

    Hierarchy

    Constructors

    Properties

    Constructors

    Properties

    cause?: Error

    The underlying error, if any.

    +

    Constructors

    Properties

    cause?: Error

    The underlying error, if any.

    IMPORTANT When this error is from the Identity Provider (IdentityProviderError) it can contain user input and is only escaped using basic escaping for putting untrusted data directly into the HTML body.

    You should not render this error without using a templating engine that will properly escape it for other HTML contexts first.

    -
    code: string

    A machine-readable error code that remains stable within a major version of the SDK. You +

    code: string

    A machine-readable error code that remains stable within a major version of the SDK. You should rely on this error code to handle errors. In contrast, the error message is not part of the API and can change anytime. Do not parse or otherwise rely on the error message to handle errors.

    -
    name: string

    The error class name.

    -
    status?: number

    The HTTP status code, if any.

    -
    code: string = 'ERR_CALLBACK_HANDLER_FAILURE'
    \ No newline at end of file +
    name: string

    The error class name.

    +
    status?: number

    The HTTP status code, if any.

    +
    code: string = 'ERR_CALLBACK_HANDLER_FAILURE'
    \ No newline at end of file diff --git a/docs/classes/utils_errors.HandlerError.html b/docs/classes/utils_errors.HandlerError.html index 00f5eec19..34b57daea 100644 --- a/docs/classes/utils_errors.HandlerError.html +++ b/docs/classes/utils_errors.HandlerError.html @@ -12,20 +12,20 @@
  • the status property contains the HTTP status code of the error, if any.
  • -

    Hierarchy

    Constructors

    Hierarchy

    Constructors

    Properties

    Constructors

    Properties

    cause?: Error

    The underlying error, if any.

    +

    Constructors

    Properties

    cause?: Error

    The underlying error, if any.

    IMPORTANT When this error is from the Identity Provider (IdentityProviderError) it can contain user input and is only escaped using basic escaping for putting untrusted data directly into the HTML body.

    You should not render this error without using a templating engine that will properly escape it for other HTML contexts first.

    -
    code: string

    A machine-readable error code that remains stable within a major version of the SDK. You +

    code: string

    A machine-readable error code that remains stable within a major version of the SDK. You should rely on this error code to handle errors. In contrast, the error message is not part of the API and can change anytime. Do not parse or otherwise rely on the error message to handle errors.

    -
    name: string

    The error class name.

    -
    status?: number

    The HTTP status code, if any.

    -
    \ No newline at end of file +
    name: string

    The error class name.

    +
    status?: number

    The HTTP status code, if any.

    +
    \ No newline at end of file diff --git a/docs/classes/utils_errors.LoginHandlerError.html b/docs/classes/utils_errors.LoginHandlerError.html index a38bd0b55..319c93474 100644 --- a/docs/classes/utils_errors.LoginHandlerError.html +++ b/docs/classes/utils_errors.LoginHandlerError.html @@ -1,20 +1,20 @@ LoginHandlerError | @auth0/nextjs-auth0

    The error thrown by the login API route handler. It extends HandlerError.

    See

    the cause property contains the underlying error.

    -

    Hierarchy

    Constructors

    Hierarchy

    Constructors

    Properties

    Constructors

    Properties

    cause?: Error

    The underlying error, if any.

    +

    Constructors

    Properties

    cause?: Error

    The underlying error, if any.

    IMPORTANT When this error is from the Identity Provider (IdentityProviderError) it can contain user input and is only escaped using basic escaping for putting untrusted data directly into the HTML body.

    You should not render this error without using a templating engine that will properly escape it for other HTML contexts first.

    -
    code: string

    A machine-readable error code that remains stable within a major version of the SDK. You +

    code: string

    A machine-readable error code that remains stable within a major version of the SDK. You should rely on this error code to handle errors. In contrast, the error message is not part of the API and can change anytime. Do not parse or otherwise rely on the error message to handle errors.

    -
    name: string

    The error class name.

    -
    status?: number

    The HTTP status code, if any.

    -
    code: string = 'ERR_LOGIN_HANDLER_FAILURE'
    \ No newline at end of file +
    name: string

    The error class name.

    +
    status?: number

    The HTTP status code, if any.

    +
    code: string = 'ERR_LOGIN_HANDLER_FAILURE'
    \ No newline at end of file diff --git a/docs/classes/utils_errors.LogoutHandlerError.html b/docs/classes/utils_errors.LogoutHandlerError.html index 49790fa9a..fb12b404a 100644 --- a/docs/classes/utils_errors.LogoutHandlerError.html +++ b/docs/classes/utils_errors.LogoutHandlerError.html @@ -1,20 +1,20 @@ LogoutHandlerError | @auth0/nextjs-auth0

    The error thrown by the logout API route handler. It extends HandlerError.

    See

    the cause property contains the underlying error.

    -

    Hierarchy

    Constructors

    Hierarchy

    Constructors

    Properties

    Constructors

    Properties

    cause?: Error

    The underlying error, if any.

    +

    Constructors

    Properties

    cause?: Error

    The underlying error, if any.

    IMPORTANT When this error is from the Identity Provider (IdentityProviderError) it can contain user input and is only escaped using basic escaping for putting untrusted data directly into the HTML body.

    You should not render this error without using a templating engine that will properly escape it for other HTML contexts first.

    -
    code: string

    A machine-readable error code that remains stable within a major version of the SDK. You +

    code: string

    A machine-readable error code that remains stable within a major version of the SDK. You should rely on this error code to handle errors. In contrast, the error message is not part of the API and can change anytime. Do not parse or otherwise rely on the error message to handle errors.

    -
    name: string

    The error class name.

    -
    status?: number

    The HTTP status code, if any.

    -
    code: string = 'ERR_LOGOUT_HANDLER_FAILURE'
    \ No newline at end of file +
    name: string

    The error class name.

    +
    status?: number

    The HTTP status code, if any.

    +
    code: string = 'ERR_LOGOUT_HANDLER_FAILURE'
    \ No newline at end of file diff --git a/docs/classes/utils_errors.ProfileHandlerError.html b/docs/classes/utils_errors.ProfileHandlerError.html index 71d4cf212..a4aa2feeb 100644 --- a/docs/classes/utils_errors.ProfileHandlerError.html +++ b/docs/classes/utils_errors.ProfileHandlerError.html @@ -1,20 +1,20 @@ ProfileHandlerError | @auth0/nextjs-auth0

    The error thrown by the profile API route handler. It extends HandlerError.

    See

    the cause property contains the underlying error.

    -

    Hierarchy

    Constructors

    Hierarchy

    Constructors

    Properties

    Constructors

    Properties

    cause?: Error

    The underlying error, if any.

    +

    Constructors

    Properties

    cause?: Error

    The underlying error, if any.

    IMPORTANT When this error is from the Identity Provider (IdentityProviderError) it can contain user input and is only escaped using basic escaping for putting untrusted data directly into the HTML body.

    You should not render this error without using a templating engine that will properly escape it for other HTML contexts first.

    -
    code: string

    A machine-readable error code that remains stable within a major version of the SDK. You +

    code: string

    A machine-readable error code that remains stable within a major version of the SDK. You should rely on this error code to handle errors. In contrast, the error message is not part of the API and can change anytime. Do not parse or otherwise rely on the error message to handle errors.

    -
    name: string

    The error class name.

    -
    status?: number

    The HTTP status code, if any.

    -
    code: string = 'ERR_PROFILE_HANDLER_FAILURE'
    \ No newline at end of file +
    name: string

    The error class name.

    +
    status?: number

    The HTTP status code, if any.

    +
    code: string = 'ERR_PROFILE_HANDLER_FAILURE'
    \ No newline at end of file diff --git a/docs/enums/utils_errors.AccessTokenErrorCode.html b/docs/enums/utils_errors.AccessTokenErrorCode.html index f93df1ef3..312cea207 100644 --- a/docs/enums/utils_errors.AccessTokenErrorCode.html +++ b/docs/enums/utils_errors.AccessTokenErrorCode.html @@ -1,8 +1,8 @@ AccessTokenErrorCode | @auth0/nextjs-auth0

    Error codes for AccessTokenError.

    -

    Enumeration Members

    Enumeration Members

    EXPIRED_ACCESS_TOKEN: "ERR_EXPIRED_ACCESS_TOKEN"
    FAILED_REFRESH_GRANT: "ERR_FAILED_REFRESH_GRANT"
    INSUFFICIENT_SCOPE: "ERR_INSUFFICIENT_SCOPE"
    MISSING_ACCESS_TOKEN: "ERR_MISSING_ACCESS_TOKEN"
    MISSING_REFRESH_TOKEN: "ERR_MISSING_REFRESH_TOKEN"
    MISSING_SESSION: "ERR_MISSING_SESSION"
    \ No newline at end of file +

    Enumeration Members

    EXPIRED_ACCESS_TOKEN: "ERR_EXPIRED_ACCESS_TOKEN"
    FAILED_REFRESH_GRANT: "ERR_FAILED_REFRESH_GRANT"
    INSUFFICIENT_SCOPE: "ERR_INSUFFICIENT_SCOPE"
    MISSING_ACCESS_TOKEN: "ERR_MISSING_ACCESS_TOKEN"
    MISSING_REFRESH_TOKEN: "ERR_MISSING_REFRESH_TOKEN"
    MISSING_SESSION: "ERR_MISSING_SESSION"
    \ No newline at end of file diff --git a/docs/functions/client_use_user.default.html b/docs/functions/client_use_user.default.html index 095105446..edb48214a 100644 --- a/docs/functions/client_use_user.default.html +++ b/docs/functions/client_use_user.default.html @@ -1 +1 @@ -default | @auth0/nextjs-auth0
    \ No newline at end of file +default | @auth0/nextjs-auth0
    \ No newline at end of file diff --git a/docs/functions/client_use_user.useUser.html b/docs/functions/client_use_user.useUser.html index ee2c610dc..a00b0ec3e 100644 --- a/docs/functions/client_use_user.useUser.html +++ b/docs/functions/client_use_user.useUser.html @@ -1,5 +1,5 @@ -useUser | @auth0/nextjs-auth0
    \ No newline at end of file diff --git a/docs/functions/config.configSingletonGetter.html b/docs/functions/config.configSingletonGetter.html index eae93e773..ce3a88e57 100644 --- a/docs/functions/config.configSingletonGetter.html +++ b/docs/functions/config.configSingletonGetter.html @@ -1 +1 @@ -configSingletonGetter | @auth0/nextjs-auth0
    \ No newline at end of file +configSingletonGetter | @auth0/nextjs-auth0
    \ No newline at end of file diff --git a/docs/functions/edge.getAccessToken-1.html b/docs/functions/edge.getAccessToken-1.html index 5a9e971d6..bbfb99e15 100644 --- a/docs/functions/edge.getAccessToken-1.html +++ b/docs/functions/edge.getAccessToken-1.html @@ -1,4 +1,4 @@ -getAccessToken | @auth0/nextjs-auth0
    \ No newline at end of file diff --git a/docs/functions/edge.getSession-1.html b/docs/functions/edge.getSession-1.html index 0f85a0e0b..bae76a4a2 100644 --- a/docs/functions/edge.getSession-1.html +++ b/docs/functions/edge.getSession-1.html @@ -1,4 +1,4 @@ -getSession | @auth0/nextjs-auth0
    \ No newline at end of file diff --git a/docs/functions/edge.handleAuth-1.html b/docs/functions/edge.handleAuth-1.html index 517119c04..16dab2a0d 100644 --- a/docs/functions/edge.handleAuth-1.html +++ b/docs/functions/edge.handleAuth-1.html @@ -1,4 +1,4 @@ -handleAuth | @auth0/nextjs-auth0
    \ No newline at end of file diff --git a/docs/functions/edge.handleCallback-1.html b/docs/functions/edge.handleCallback-1.html index 22daf099d..b80a1c9ff 100644 --- a/docs/functions/edge.handleCallback-1.html +++ b/docs/functions/edge.handleCallback-1.html @@ -1 +1 @@ -handleCallback | @auth0/nextjs-auth0
    \ No newline at end of file +handleCallback | @auth0/nextjs-auth0
    \ No newline at end of file diff --git a/docs/functions/edge.handleLogin-1.html b/docs/functions/edge.handleLogin-1.html index adf5df65b..0c614a829 100644 --- a/docs/functions/edge.handleLogin-1.html +++ b/docs/functions/edge.handleLogin-1.html @@ -1 +1 @@ -handleLogin | @auth0/nextjs-auth0
    \ No newline at end of file +handleLogin | @auth0/nextjs-auth0
    \ No newline at end of file diff --git a/docs/functions/edge.handleLogout-1.html b/docs/functions/edge.handleLogout-1.html index 70566f358..63d3f909b 100644 --- a/docs/functions/edge.handleLogout-1.html +++ b/docs/functions/edge.handleLogout-1.html @@ -1 +1 @@ -handleLogout | @auth0/nextjs-auth0
    \ No newline at end of file +handleLogout | @auth0/nextjs-auth0
    \ No newline at end of file diff --git a/docs/functions/edge.handleProfile-1.html b/docs/functions/edge.handleProfile-1.html index 3be96baeb..bc7b80178 100644 --- a/docs/functions/edge.handleProfile-1.html +++ b/docs/functions/edge.handleProfile-1.html @@ -1 +1 @@ -handleProfile | @auth0/nextjs-auth0
    \ No newline at end of file +handleProfile | @auth0/nextjs-auth0
    \ No newline at end of file diff --git a/docs/functions/edge.initAuth0-1.html b/docs/functions/edge.initAuth0-1.html index 0280ef2a4..d535f2688 100644 --- a/docs/functions/edge.initAuth0-1.html +++ b/docs/functions/edge.initAuth0-1.html @@ -1,3 +1,3 @@ -initAuth0 | @auth0/nextjs-auth0
    \ No newline at end of file diff --git a/docs/functions/edge.touchSession-1.html b/docs/functions/edge.touchSession-1.html index 1fafd5ee0..b49cd7d7f 100644 --- a/docs/functions/edge.touchSession-1.html +++ b/docs/functions/edge.touchSession-1.html @@ -1,4 +1,4 @@ -touchSession | @auth0/nextjs-auth0
    \ No newline at end of file diff --git a/docs/functions/edge.updateSession-1.html b/docs/functions/edge.updateSession-1.html index faba43fc8..d23f4fff5 100644 --- a/docs/functions/edge.updateSession-1.html +++ b/docs/functions/edge.updateSession-1.html @@ -1,4 +1,4 @@ -updateSession | @auth0/nextjs-auth0
    \ No newline at end of file diff --git a/docs/functions/edge.withApiAuthRequired-1.html b/docs/functions/edge.withApiAuthRequired-1.html index 55ec3162f..87e966d54 100644 --- a/docs/functions/edge.withApiAuthRequired-1.html +++ b/docs/functions/edge.withApiAuthRequired-1.html @@ -1,11 +1,11 @@ -withApiAuthRequired | @auth0/nextjs-auth0

    Function withApiAuthRequired

    \ No newline at end of file diff --git a/docs/functions/edge.withMiddlewareAuthRequired.html b/docs/functions/edge.withMiddlewareAuthRequired.html index 22295a70d..ab84dde3d 100644 --- a/docs/functions/edge.withMiddlewareAuthRequired.html +++ b/docs/functions/edge.withMiddlewareAuthRequired.html @@ -1,4 +1,4 @@ -withMiddlewareAuthRequired | @auth0/nextjs-auth0

    Function withMiddlewareAuthRequired

    \ No newline at end of file diff --git a/docs/functions/edge.withPageAuthRequired-1.html b/docs/functions/edge.withPageAuthRequired-1.html index b01585281..c13a33fdf 100644 --- a/docs/functions/edge.withPageAuthRequired-1.html +++ b/docs/functions/edge.withPageAuthRequired-1.html @@ -1,10 +1,10 @@ -withPageAuthRequired | @auth0/nextjs-auth0

    Function withPageAuthRequired

    \ No newline at end of file diff --git a/docs/functions/handlers_router_helpers.getHandler.html b/docs/functions/handlers_router_helpers.getHandler.html index 53c99e5b0..c7d5cbab5 100644 --- a/docs/functions/handlers_router_helpers.getHandler.html +++ b/docs/functions/handlers_router_helpers.getHandler.html @@ -1 +1 @@ -getHandler | @auth0/nextjs-auth0
    • Type Parameters

      • Opts extends Record<string, any>

      Parameters

      Returns ((reqOrOptions, resOrCtx, options?) => void | Promise<void> | Response | Promise<Response> | ((req, resOrCtxInner) => void | Promise<void> | Response | Promise<Response>))

        • (reqOrOptions, resOrCtx, options?): void | Promise<void> | Response | Promise<Response> | ((req, resOrCtxInner) => void | Promise<void> | Response | Promise<Response>)
        • Parameters

          • reqOrOptions: NextApiRequest | NextRequest | Opts
          • resOrCtx: NextApiResponse<any> | AppRouteHandlerFnContext
          • Optional options: Opts

          Returns void | Promise<void> | Response | Promise<Response> | ((req, resOrCtxInner) => void | Promise<void> | Response | Promise<Response>)

    \ No newline at end of file +getHandler | @auth0/nextjs-auth0
    • Type Parameters

      • Opts extends Record<string, any>

      Parameters

      Returns ((reqOrOptions, resOrCtx, options?) => void | Promise<void> | Response | Promise<Response> | ((req, resOrCtxInner) => void | Promise<void> | Response | Promise<Response>))

        • (reqOrOptions, resOrCtx, options?): void | Promise<void> | Response | Promise<Response> | ((req, resOrCtxInner) => void | Promise<void> | Response | Promise<Response>)
        • Parameters

          • reqOrOptions: NextApiRequest | NextRequest | Opts
          • resOrCtx: NextApiResponse<any> | AppRouteHandlerFnContext
          • Optional options: Opts

          Returns void | Promise<void> | Response | Promise<Response> | ((req, resOrCtxInner) => void | Promise<void> | Response | Promise<Response>)

    \ No newline at end of file diff --git a/docs/functions/helpers_testing.generateSessionCookie.html b/docs/functions/helpers_testing.generateSessionCookie.html index 5154a90ba..0b6396bd4 100644 --- a/docs/functions/helpers_testing.generateSessionCookie.html +++ b/docs/functions/helpers_testing.generateSessionCookie.html @@ -1 +1 @@ -generateSessionCookie | @auth0/nextjs-auth0
    \ No newline at end of file +generateSessionCookie | @auth0/nextjs-auth0
    \ No newline at end of file diff --git a/docs/functions/index.getAccessToken-1.html b/docs/functions/index.getAccessToken-1.html index 90e5998d1..a17009e5f 100644 --- a/docs/functions/index.getAccessToken-1.html +++ b/docs/functions/index.getAccessToken-1.html @@ -1,4 +1,4 @@ -getAccessToken | @auth0/nextjs-auth0
    \ No newline at end of file diff --git a/docs/functions/index.getSession-1.html b/docs/functions/index.getSession-1.html index 076e116f2..9cd28aa96 100644 --- a/docs/functions/index.getSession-1.html +++ b/docs/functions/index.getSession-1.html @@ -1,4 +1,4 @@ -getSession | @auth0/nextjs-auth0
    \ No newline at end of file diff --git a/docs/functions/index.handleAuth-1.html b/docs/functions/index.handleAuth-1.html index f0ddee70c..cc516a55f 100644 --- a/docs/functions/index.handleAuth-1.html +++ b/docs/functions/index.handleAuth-1.html @@ -1,4 +1,4 @@ -handleAuth | @auth0/nextjs-auth0
    \ No newline at end of file diff --git a/docs/functions/index.handleCallback-1.html b/docs/functions/index.handleCallback-1.html index dff529e69..6ffa66214 100644 --- a/docs/functions/index.handleCallback-1.html +++ b/docs/functions/index.handleCallback-1.html @@ -1 +1 @@ -handleCallback | @auth0/nextjs-auth0
    \ No newline at end of file +handleCallback | @auth0/nextjs-auth0
    \ No newline at end of file diff --git a/docs/functions/index.handleLogin-1.html b/docs/functions/index.handleLogin-1.html index a0f7562c9..75d09b370 100644 --- a/docs/functions/index.handleLogin-1.html +++ b/docs/functions/index.handleLogin-1.html @@ -1 +1 @@ -handleLogin | @auth0/nextjs-auth0
    \ No newline at end of file +handleLogin | @auth0/nextjs-auth0
    \ No newline at end of file diff --git a/docs/functions/index.handleLogout-1.html b/docs/functions/index.handleLogout-1.html index 175b2354c..18c378350 100644 --- a/docs/functions/index.handleLogout-1.html +++ b/docs/functions/index.handleLogout-1.html @@ -1 +1 @@ -handleLogout | @auth0/nextjs-auth0
    \ No newline at end of file +handleLogout | @auth0/nextjs-auth0
    \ No newline at end of file diff --git a/docs/functions/index.handleProfile-1.html b/docs/functions/index.handleProfile-1.html index ce93e2ec8..0e289b29e 100644 --- a/docs/functions/index.handleProfile-1.html +++ b/docs/functions/index.handleProfile-1.html @@ -1 +1 @@ -handleProfile | @auth0/nextjs-auth0
    \ No newline at end of file +handleProfile | @auth0/nextjs-auth0
    \ No newline at end of file diff --git a/docs/functions/index.initAuth0-1.html b/docs/functions/index.initAuth0-1.html index 8c686be41..cf8d5119b 100644 --- a/docs/functions/index.initAuth0-1.html +++ b/docs/functions/index.initAuth0-1.html @@ -1,3 +1,3 @@ -initAuth0 | @auth0/nextjs-auth0
    \ No newline at end of file diff --git a/docs/functions/index.touchSession-1.html b/docs/functions/index.touchSession-1.html index d9fc1a1b2..23682ef78 100644 --- a/docs/functions/index.touchSession-1.html +++ b/docs/functions/index.touchSession-1.html @@ -1,4 +1,4 @@ -touchSession | @auth0/nextjs-auth0
    \ No newline at end of file diff --git a/docs/functions/index.updateSession-1.html b/docs/functions/index.updateSession-1.html index 15640e329..d431d7ce0 100644 --- a/docs/functions/index.updateSession-1.html +++ b/docs/functions/index.updateSession-1.html @@ -1,4 +1,4 @@ -updateSession | @auth0/nextjs-auth0
    \ No newline at end of file diff --git a/docs/functions/index.withApiAuthRequired-1.html b/docs/functions/index.withApiAuthRequired-1.html index 0ba7cd35c..1ecdcf24c 100644 --- a/docs/functions/index.withApiAuthRequired-1.html +++ b/docs/functions/index.withApiAuthRequired-1.html @@ -1,11 +1,11 @@ -withApiAuthRequired | @auth0/nextjs-auth0
    \ No newline at end of file diff --git a/docs/functions/index.withPageAuthRequired-1.html b/docs/functions/index.withPageAuthRequired-1.html index 30b470f32..44585c782 100644 --- a/docs/functions/index.withPageAuthRequired-1.html +++ b/docs/functions/index.withPageAuthRequired-1.html @@ -1,10 +1,10 @@ -withPageAuthRequired | @auth0/nextjs-auth0
    \ No newline at end of file diff --git a/docs/functions/init._initAuth.html b/docs/functions/init._initAuth.html index 32fa38e3b..4f2559c5b 100644 --- a/docs/functions/init._initAuth.html +++ b/docs/functions/init._initAuth.html @@ -1 +1 @@ -_initAuth | @auth0/nextjs-auth0
    • Parameters

      • __namedParameters: {
            clientGetter: ((telemetry) => GetClient);
            genId: (() => string);
            params?: DeepPartial<NextConfig>;
        }
        • clientGetter: ((telemetry) => GetClient)
            • (telemetry): GetClient
            • Parameters

              • telemetry: Telemetry

              Returns GetClient

        • genId: (() => string)
            • (): string
            • Returns string

        • Optional params?: DeepPartial<NextConfig>

      Returns Auth0Server

    \ No newline at end of file +_initAuth | @auth0/nextjs-auth0
    • Parameters

      • __namedParameters: {
            clientGetter: ((telemetry) => GetClient);
            genId: (() => string);
            params?: DeepPartial<NextConfig>;
        }
        • clientGetter: ((telemetry) => GetClient)
            • (telemetry): GetClient
            • Parameters

              • telemetry: Telemetry

              Returns GetClient

        • genId: (() => string)
            • (): string
            • Returns string

        • Optional params?: DeepPartial<NextConfig>

      Returns Auth0Server

    \ No newline at end of file diff --git a/docs/interfaces/client_use_user.UserProfile.html b/docs/interfaces/client_use_user.UserProfile.html index af11aa029..6c7aab59d 100644 --- a/docs/interfaces/client_use_user.UserProfile.html +++ b/docs/interfaces/client_use_user.UserProfile.html @@ -1,5 +1,5 @@ UserProfile | @auth0/nextjs-auth0

    The user claims returned from the useUser hook.

    -

    Hierarchy

    • UserProfile

    Indexable

    [key: string]: unknown

    Properties

    interface UserProfile {
        email?: null | string;
        email_verified?: null | boolean;
        name?: null | string;
        nickname?: null | string;
        org_id?: null | string;
        picture?: null | string;
        sub?: null | string;
        updated_at?: null | string;
        [key: string]: unknown;
    }

    Indexable

    [key: string]: unknown

    Properties

    email?: null | string
    email_verified?: null | boolean
    name?: null | string
    nickname?: null | string
    org_id?: null | string
    picture?: null | string
    sub?: null | string
    updated_at?: null | string
    \ No newline at end of file +

    Properties

    email?: null | string
    email_verified?: null | boolean
    name?: null | string
    nickname?: null | string
    org_id?: null | string
    picture?: null | string
    sub?: null | string
    updated_at?: null | string
    \ No newline at end of file diff --git a/docs/interfaces/client_with_page_auth_required.UserProps.html b/docs/interfaces/client_with_page_auth_required.UserProps.html index 692d1ed2d..645f757a9 100644 --- a/docs/interfaces/client_with_page_auth_required.UserProps.html +++ b/docs/interfaces/client_with_page_auth_required.UserProps.html @@ -1,2 +1,2 @@ -UserProps | @auth0/nextjs-auth0
    \ No newline at end of file +UserProps | @auth0/nextjs-auth0
    \ No newline at end of file diff --git a/docs/interfaces/client_with_page_auth_required.WithPageAuthRequiredOptions.html b/docs/interfaces/client_with_page_auth_required.WithPageAuthRequiredOptions.html index e8db6b326..dcecc43b0 100644 --- a/docs/interfaces/client_with_page_auth_required.WithPageAuthRequiredOptions.html +++ b/docs/interfaces/client_with_page_auth_required.WithPageAuthRequiredOptions.html @@ -1,14 +1,14 @@ WithPageAuthRequiredOptions | @auth0/nextjs-auth0

    Options to customize the withPageAuthRequired higher order component.

    -

    Hierarchy

    • WithPageAuthRequiredOptions

    Properties

    interface WithPageAuthRequiredOptions {
        onError?: ((error) => Element);
        onRedirecting?: (() => Element);
        returnTo?: string;
    }

    Properties

    onError?: ((error) => Element)

    Type declaration

      • (error): Element
      • withPageAuthRequired(Profile, {
        onError: error => <div>Error: {error.message}</div>
        });

        Render a fallback in case of error fetching the user from the profile API route.

        -

        Parameters

        • error: Error

        Returns Element

    onRedirecting?: (() => Element)

    Type declaration

      • (): Element
      • withPageAuthRequired(Profile, {
        onRedirecting: () => <div>Redirecting you to the login...</div>
        }); +

        Parameters

        • error: Error

        Returns Element

    onRedirecting?: (() => Element)

    Type declaration

      • (): Element
      • withPageAuthRequired(Profile, {
        onRedirecting: () => <div>Redirecting you to the login...</div>
        });

        Render a message to show that the user is being redirected to the login.

        -

        Returns Element

    returnTo?: string
    withPageAuthRequired(Profile, {
    returnTo: '/profile'
    }); +

    Returns Element

    returnTo?: string
    withPageAuthRequired(Profile, {
    returnTo: '/profile'
    });

    Add a path to return the user to after login.

    -
    \ No newline at end of file +
    \ No newline at end of file diff --git a/docs/interfaces/config.NextConfig.html b/docs/interfaces/config.NextConfig.html index 2d44f756e..857728aa1 100644 --- a/docs/interfaces/config.NextConfig.html +++ b/docs/interfaces/config.NextConfig.html @@ -1,7 +1,7 @@ -NextConfig | @auth0/nextjs-auth0

    Hierarchy

    • Config
      • NextConfig

    Properties

    organization? +NextConfig | @auth0/nextjs-auth0
    interface NextConfig {
        organization?: string;
        routes: {} & {
            login: string;
        };
    }

    Hierarchy

    • Config
      • NextConfig

    Properties

    organization?: string

    Log users in to a specific organization.

    This will specify an organization parameter in your user's login request and will add a step to validate the org_id or org_name claim in your user's ID token.

    If your app supports multiple organizations, you should take a look at AuthorizationParams.organization.

    -
    routes: {} & {
        login: string;
    }

    Type declaration

      Type declaration

      • login: string
      \ No newline at end of file +
      routes: {} & {
          login: string;
      }

      Type declaration

        Type declaration

        • login: string
        \ No newline at end of file diff --git a/docs/interfaces/handlers_callback.CallbackOptions.html b/docs/interfaces/handlers_callback.CallbackOptions.html index 0db5158dc..d979972f0 100644 --- a/docs/interfaces/handlers_callback.CallbackOptions.html +++ b/docs/interfaces/handlers_callback.CallbackOptions.html @@ -1,13 +1,13 @@ CallbackOptions | @auth0/nextjs-auth0

        Options to customize the callback handler.

        Hierarchy

        • CallbackOptions

        Properties

        interface CallbackOptions {
            afterCallback?: AfterCallback;
            authorizationParams?: Partial<AuthorizationParameters>;
            organization?: string;
            redirectUri?: string;
        }

        Properties

        afterCallback?: AfterCallback
        authorizationParams?: Partial<AuthorizationParameters>

        This is useful for sending custom query parameters in the body of the code exchange request +

        Properties

        afterCallback?: AfterCallback
        authorizationParams?: Partial<AuthorizationParameters>

        This is useful for sending custom query parameters in the body of the code exchange request for use in Actions/Rules.

        -
        organization?: string

        This is useful to specify instead of NextConfig.organization when your app has multiple +

        organization?: string

        This is useful to specify instead of NextConfig.organization when your app has multiple organizations, it should match LoginOptions.authorizationParams.

        -
        redirectUri?: string

        This is useful to specify in addition to BaseConfig.baseURL when your app runs on multiple domains, +

        redirectUri?: string

        This is useful to specify in addition to BaseConfig.baseURL when your app runs on multiple domains, it should match LoginOptions.authorizationParams.redirect_uri.

        -
        \ No newline at end of file +
        \ No newline at end of file diff --git a/docs/interfaces/handlers_login.AuthorizationParams.html b/docs/interfaces/handlers_login.AuthorizationParams.html index 6b5565c27..47be659da 100644 --- a/docs/interfaces/handlers_login.AuthorizationParams.html +++ b/docs/interfaces/handlers_login.AuthorizationParams.html @@ -1,5 +1,5 @@ AuthorizationParams | @auth0/nextjs-auth0

        Authorization params to pass to the login handler.

        -

        Hierarchy

        • Partial<AuthorizationParameters>
          • AuthorizationParams

        Properties

        interface AuthorizationParams {
            connection?: string;
            connection_scope?: string;
            invitation?: string;
            organization?: string;
            screen_hint?: string;
        }

        Hierarchy

        • Partial<AuthorizationParameters>
          • AuthorizationParams

        Properties

        connection? connection_scope? invitation? organization? @@ -9,19 +9,19 @@ By default no connection is specified, so the Universal Login page will be displayed.

        import { handleAuth, handleLogin } from '@auth0/nextjs-auth0';

        export default handleAuth({
        login: async (req, res) => {
        try {
        await handleLogin(req, res, {
        // Get the connection name from the Auth0 Dashboard
        authorizationParams: { connection: 'github' }
        });
        } catch (error) {
        console.error(error);
        }
        }
        });
        -
        connection_scope?: string

        Provider scopes for OAuth2/social connections, such as GitHub or Google.

        +
        connection_scope?: string

        Provider scopes for OAuth2/social connections, such as GitHub or Google.

        import { handleAuth, handleLogin } from '@auth0/nextjs-auth0';

        export default handleAuth({
        login: async (req, res) => {
        try {
        await handleLogin(req, res, {
        authorizationParams: {
        connection: 'github',
        connection_scope: 'public_repo read:user'
        }
        });
        } catch (error) {
        console.error(error);
        }
        }
        });
        -
        invitation?: string

        The invitation id to join an organization.

        +
        invitation?: string

        The invitation id to join an organization.

        To create a link for your user's to accept an organization invite, read the invitation and organization query params and pass them to the authorization server to log the user in:

        // pages/api/invite.js
        import { handleLogin } from '@auth0/nextjs-auth0';

        export default async function invite(req, res) {
        try {
        const { invitation, organization } = req.query;
        if (!invitation) {
        res.status(400).end('Missing "invitation" parameter');
        }
        await handleLogin(req, res, {
        authorizationParams: {
        invitation,
        organization
        }
        });
        } catch (error) {
        res.status(error.status || 500).end();
        }
        } ;

        Your invite url can then take the format: https://example.com/api/invite?invitation=invitation_id&organization=org_id_or_name.

        -
        organization?: string

        This is useful to specify instead of NextConfig.organization when your app has multiple +

        organization?: string

        This is useful to specify instead of NextConfig.organization when your app has multiple organizations. It should match CallbackOptions.organization.

        -
        screen_hint?: string

        Provides a hint to Auth0 as to what flow should be displayed. The default behavior is to show a +

        screen_hint?: string

        Provides a hint to Auth0 as to what flow should be displayed. The default behavior is to show a login page but you can override this by passing 'signup' to show the signup page instead.

        This only affects the New Universal Login Experience.

        -
        \ No newline at end of file +
        \ No newline at end of file diff --git a/docs/interfaces/handlers_login.LoginOptions.html b/docs/interfaces/handlers_login.LoginOptions.html index f4612cd67..ae63271a2 100644 --- a/docs/interfaces/handlers_login.LoginOptions.html +++ b/docs/interfaces/handlers_login.LoginOptions.html @@ -1,9 +1,9 @@ LoginOptions | @auth0/nextjs-auth0

        Options to customize the login handler.

        Hierarchy

        • LoginOptions

        Properties

        interface LoginOptions {
            authorizationParams?: AuthorizationParams;
            getLoginState?: GetLoginState;
            returnTo?: string;
        }

        Properties

        authorizationParams?: AuthorizationParams

        Override the default BaseConfig.authorizationParams authorizationParams.

        -
        getLoginState?: GetLoginState

        Generate a unique state value for use during login transactions.

        -
        returnTo?: string

        URL to return to after login. Overrides the default in BaseConfig.baseURL.

        -
        \ No newline at end of file +
        getLoginState?: GetLoginState

        Generate a unique state value for use during login transactions.

        +
        returnTo?: string

        URL to return to after login. Overrides the default in BaseConfig.baseURL.

        +
        \ No newline at end of file diff --git a/docs/interfaces/handlers_logout.LogoutOptions.html b/docs/interfaces/handlers_logout.LogoutOptions.html index 6d0349589..8cce24461 100644 --- a/docs/interfaces/handlers_logout.LogoutOptions.html +++ b/docs/interfaces/handlers_logout.LogoutOptions.html @@ -1,8 +1,8 @@ LogoutOptions | @auth0/nextjs-auth0

        Options to customize the logout handler.

        Hierarchy

        • LogoutOptions

        Properties

        interface LogoutOptions {
            logoutParams?: {
                [key: string]: any;
            };
            returnTo?: string;
        }

        Properties

        logoutParams?: {
            [key: string]: any;
        }

        Additional custom parameters to pass to the logout endpoint.

        -

        Type declaration

        • [key: string]: any
        returnTo?: string

        URL to return to after logout. Overrides the default +

        Type declaration

        • [key: string]: any
        returnTo?: string

        URL to return to after logout. Overrides the default in BaseConfig.routes.postLogoutRedirect routes.postLogoutRedirect.

        -
        \ No newline at end of file +
        \ No newline at end of file diff --git a/docs/interfaces/session_get_access_token.AccessTokenRequest.html b/docs/interfaces/session_get_access_token.AccessTokenRequest.html index 0aef5c56a..40b463616 100644 --- a/docs/interfaces/session_get_access_token.AccessTokenRequest.html +++ b/docs/interfaces/session_get_access_token.AccessTokenRequest.html @@ -1,5 +1,5 @@ AccessTokenRequest | @auth0/nextjs-auth0

        Custom options to get an access token.

        -

        Hierarchy

        • AccessTokenRequest

        Properties

        interface AccessTokenRequest {
            afterRefresh?: AfterRefresh;
            authorizationParams?: Partial<AuthorizationParameters>;
            refresh?: boolean;
            scopes?: string[];
        }

        Properties

        afterRefresh? authorizationParams? refresh? scopes? @@ -7,13 +7,12 @@ Use this to modify the session after it is refreshed. Usually used to keep updates in sync with the AfterCallback hook.

        See

        also the AfterRefetch hook.

        -

        Example

        Modify the session after refresh

        -
        // pages/api/my-handler.js
        import { getAccessToken } from '@auth0/nextjs-auth0';

        const afterRefresh = (req, res, session) => {
        session.user.customProperty = 'foo';
        delete session.idToken;
        return session;
        };

        export default async function MyHandler(req, res) {
        const accessToken = await getAccessToken(req, res, {
        refresh: true,
        afterRefresh,
        });
        }; +

        Example: Modify the session after refresh

        // pages/api/my-handler.js
        import { getAccessToken } from '@auth0/nextjs-auth0';

        const afterRefresh = (req, res, session) => {
        session.user.customProperty = 'foo';
        delete session.idToken;
        return session;
        };

        export default async function MyHandler(req, res) {
        const accessToken = await getAccessToken(req, res, {
        refresh: true,
        afterRefresh,
        });
        };
        -
        authorizationParams?: Partial<AuthorizationParameters>

        This is useful for sending custom query parameters in the body of the refresh grant request for use in rules.

        -
        refresh?: boolean

        If set to true, a new access token will be requested with the refresh token grant, regardless of whether +

        authorizationParams?: Partial<AuthorizationParameters>

        This is useful for sending custom query parameters in the body of the refresh grant request for use in rules.

        +
        refresh?: boolean

        If set to true, a new access token will be requested with the refresh token grant, regardless of whether the access token has expired or not.

        IMPORTANT You need to request the offline_access scope on login to get a refresh token from Auth0.

        -
        scopes?: string[]

        A list of desired scopes for your access token.

        -
        \ No newline at end of file +
        scopes?: string[]

        A list of desired scopes for your access token.

        +
        \ No newline at end of file diff --git a/docs/interfaces/session_get_access_token.GetAccessTokenResult.html b/docs/interfaces/session_get_access_token.GetAccessTokenResult.html index 85261d1e2..06125d2b6 100644 --- a/docs/interfaces/session_get_access_token.GetAccessTokenResult.html +++ b/docs/interfaces/session_get_access_token.GetAccessTokenResult.html @@ -1,4 +1,4 @@ GetAccessTokenResult | @auth0/nextjs-auth0

        Response from requesting an access token.

        -

        Hierarchy

        • GetAccessTokenResult

        Properties

        interface GetAccessTokenResult {
            accessToken?: string;
        }

        Properties

        Properties

        accessToken?: string

        Access token returned from the token cache.

        -
        \ No newline at end of file +
        \ No newline at end of file diff --git a/docs/interfaces/session_session.Claims.html b/docs/interfaces/session_session.Claims.html index e560e67f9..705458179 100644 --- a/docs/interfaces/session_session.Claims.html +++ b/docs/interfaces/session_session.Claims.html @@ -1,2 +1,2 @@ Claims | @auth0/nextjs-auth0
        \ No newline at end of file +
        interface Claims {
            [key: string]: any;
        }

        Indexable

        [key: string]: any
        \ No newline at end of file diff --git a/docs/interfaces/shared.Auth0Server.html b/docs/interfaces/shared.Auth0Server.html index afc060f2f..47c16532b 100644 --- a/docs/interfaces/shared.Auth0Server.html +++ b/docs/interfaces/shared.Auth0Server.html @@ -1,7 +1,7 @@ Auth0Server | @auth0/nextjs-auth0

        The SDK server instance.

        This is created for you when you use the named exports, or you can create your own using InitAuth0.

        See ConfigParameters for more info.

        -

        Hierarchy

        • Auth0Server

        Properties

        interface Auth0Server {
            getAccessToken: GetAccessToken;
            getSession: GetSession;
            handleAuth: HandleAuth;
            handleBackchannelLogout: HandleBackchannelLogout;
            handleCallback: HandleCallback;
            handleLogin: HandleLogin;
            handleLogout: HandleLogout;
            handleProfile: HandleProfile;
            touchSession: TouchSession;
            updateSession: UpdateSession;
            withApiAuthRequired: WithApiAuthRequired;
            withMiddlewareAuthRequired: WithMiddlewareAuthRequired;
            withPageAuthRequired: WithPageAuthRequired;
        }

        Properties

        getAccessToken: GetAccessToken

        Access token getter.

        -
        getSession: GetSession

        Session getter.

        -
        handleAuth: HandleAuth

        Create the main handlers for your api routes.

        -
        handleBackchannelLogout: HandleBackchannelLogout

        Logout handler which will clear the local session and the Auth0 session.

        -
        handleCallback: HandleCallback

        Callback handler which will complete the transaction and create a local session.

        -
        handleLogin: HandleLogin

        Login handler which will redirect the user to Auth0.

        -
        handleLogout: HandleLogout

        Logout handler which will clear the local session and the Auth0 session.

        -
        handleProfile: HandleProfile

        Profile handler which return profile information about the user.

        -
        touchSession: TouchSession

        Update the expiry of a rolling session when autoSave is disabled.

        -
        updateSession: UpdateSession

        Append properties to the user.

        -
        withApiAuthRequired: WithApiAuthRequired

        Helper that adds auth to an API route.

        -
        withMiddlewareAuthRequired: WithMiddlewareAuthRequired

        Add auth to your middleware functions.

        -
        withPageAuthRequired: WithPageAuthRequired

        Helper that adds auth to a Page route.

        -
        \ No newline at end of file +
        getSession: GetSession

        Session getter.

        +
        handleAuth: HandleAuth

        Create the main handlers for your api routes.

        +
        handleBackchannelLogout: HandleBackchannelLogout

        Logout handler which will clear the local session and the Auth0 session.

        +
        handleCallback: HandleCallback

        Callback handler which will complete the transaction and create a local session.

        +
        handleLogin: HandleLogin

        Login handler which will redirect the user to Auth0.

        +
        handleLogout: HandleLogout

        Logout handler which will clear the local session and the Auth0 session.

        +
        handleProfile: HandleProfile

        Profile handler which return profile information about the user.

        +
        touchSession: TouchSession

        Update the expiry of a rolling session when autoSave is disabled.

        +
        updateSession: UpdateSession

        Append properties to the user.

        +
        withApiAuthRequired: WithApiAuthRequired

        Helper that adds auth to an API route.

        +
        withMiddlewareAuthRequired: WithMiddlewareAuthRequired

        Add auth to your middleware functions.

        +
        withPageAuthRequired: WithPageAuthRequired

        Helper that adds auth to a Page route.

        +
        \ No newline at end of file diff --git a/docs/modules/client.html b/docs/modules/client.html index b9a92ce17..e9a0cd01f 100644 --- a/docs/modules/client.html +++ b/docs/modules/client.html @@ -1,4 +1,4 @@ -client | @auth0/nextjs-auth0

        References

        RequestError +client | @auth0/nextjs-auth0

        References

        RequestError UserProfile UserProvider UserProviderProps diff --git a/docs/modules/client_use_user.html b/docs/modules/client_use_user.html index 8b2e7fa5f..c74a530f9 100644 --- a/docs/modules/client_use_user.html +++ b/docs/modules/client_use_user.html @@ -1,4 +1,4 @@ -client/use-user | @auth0/nextjs-auth0

        Index

        Client

        RequestError +client/use-user | @auth0/nextjs-auth0

        Index

        Client

        RequestError UserProfile UserContext UserProvider diff --git a/docs/modules/client_with_page_auth_required.html b/docs/modules/client_with_page_auth_required.html index 742401b3b..98b494769 100644 --- a/docs/modules/client_with_page_auth_required.html +++ b/docs/modules/client_with_page_auth_required.html @@ -1,4 +1,4 @@ -client/with-page-auth-required | @auth0/nextjs-auth0

        Module client/with-page-auth-required

        Index

        Client

        WithPageAuthRequiredOptions +client/with-page-auth-required | @auth0/nextjs-auth0
        \ No newline at end of file diff --git a/docs/modules/config.html b/docs/modules/config.html index 91704667a..857367eca 100644 --- a/docs/modules/config.html +++ b/docs/modules/config.html @@ -1,4 +1,4 @@ -config | @auth0/nextjs-auth0

        Index

        Other

        GetConfig +config | @auth0/nextjs-auth0

        Index

        Other

        Server

        server

        NextConfig diff --git a/docs/modules/edge.html b/docs/modules/edge.html index 32ac4e85d..e8ba9fd2e 100644 --- a/docs/modules/edge.html +++ b/docs/modules/edge.html @@ -1,4 +1,4 @@ -edge | @auth0/nextjs-auth0

        Other

        AccessTokenError +edge | @auth0/nextjs-auth0

        Other

        AccessTokenError AccessTokenErrorCode AccessTokenRequest AfterCallback diff --git a/docs/modules/handlers.html b/docs/modules/handlers.html index f5d8d90c4..587ff65c3 100644 --- a/docs/modules/handlers.html +++ b/docs/modules/handlers.html @@ -1,4 +1,4 @@ -handlers | @auth0/nextjs-auth0

        References

        AfterCallback +handlers | @auth0/nextjs-auth0

        References

        AfterCallback AfterCallbackAppRoute AfterCallbackPageRoute AfterRefetch diff --git a/docs/modules/handlers_auth.html b/docs/modules/handlers_auth.html index 3164b83f6..93f3e092a 100644 --- a/docs/modules/handlers_auth.html +++ b/docs/modules/handlers_auth.html @@ -1,4 +1,4 @@ -handlers/auth | @auth0/nextjs-auth0

        Index

        Other

        AppRouterOnError +handlers/auth | @auth0/nextjs-auth0

        Index

        Other

        Server

        HandleAuth Handlers PageRouterOnError diff --git a/docs/modules/handlers_backchannel_logout.html b/docs/modules/handlers_backchannel_logout.html index 09c294aad..c2e30380d 100644 --- a/docs/modules/handlers_backchannel_logout.html +++ b/docs/modules/handlers_backchannel_logout.html @@ -1,2 +1,2 @@ -handlers/backchannel-logout | @auth0/nextjs-auth0

        Module handlers/backchannel-logout

        Index

        Server

        HandleBackchannelLogout +handlers/backchannel-logout | @auth0/nextjs-auth0
        \ No newline at end of file diff --git a/docs/modules/handlers_callback.html b/docs/modules/handlers_callback.html index c031832a6..d205203c9 100644 --- a/docs/modules/handlers_callback.html +++ b/docs/modules/handlers_callback.html @@ -1,4 +1,4 @@ -handlers/callback | @auth0/nextjs-auth0

        Module handlers/callback

        Index

        Other

        AfterCallback +handlers/callback | @auth0/nextjs-auth0

        Module handlers/callback

        Index

        Other

        Server

        CallbackOptions AfterCallbackAppRoute AfterCallbackPageRoute diff --git a/docs/modules/handlers_login.html b/docs/modules/handlers_login.html index fbc1b3ee9..cea0ddde0 100644 --- a/docs/modules/handlers_login.html +++ b/docs/modules/handlers_login.html @@ -1,4 +1,4 @@ -handlers/login | @auth0/nextjs-auth0

        Index

        Other

        GetLoginState +handlers/login | @auth0/nextjs-auth0

        Index

        Other

        Server

        AuthorizationParams LoginOptions GetLoginStateAppRoute diff --git a/docs/modules/handlers_logout.html b/docs/modules/handlers_logout.html index 1a3c7ee3e..e846413cf 100644 --- a/docs/modules/handlers_logout.html +++ b/docs/modules/handlers_logout.html @@ -1,4 +1,4 @@ -handlers/logout | @auth0/nextjs-auth0

        Index

        Server

        LogoutOptions +handlers/logout | @auth0/nextjs-auth0

        Index

        Server

        LogoutOptions HandleLogout LogoutHandler LogoutOptionsProvider diff --git a/docs/modules/handlers_profile.html b/docs/modules/handlers_profile.html index 4142887db..dc80e0e1d 100644 --- a/docs/modules/handlers_profile.html +++ b/docs/modules/handlers_profile.html @@ -1,4 +1,4 @@ -handlers/profile | @auth0/nextjs-auth0

        Index

        Server

        AfterRefetch +handlers/profile | @auth0/nextjs-auth0

        Index

        Server

        AfterRefetch AfterRefetchAppRoute AfterRefetchPageRoute HandleProfile diff --git a/docs/modules/handlers_router_helpers.html b/docs/modules/handlers_router_helpers.html index 1d651cbf1..35ad52a97 100644 --- a/docs/modules/handlers_router_helpers.html +++ b/docs/modules/handlers_router_helpers.html @@ -1,4 +1,4 @@ -handlers/router-helpers | @auth0/nextjs-auth0

        Module handlers/router-helpers

        Index

        Type Aliases

        AppRouteHandlerFn +handlers/router-helpers | @auth0/nextjs-auth0

        Module handlers/router-helpers

        Index

        Type Aliases

        AppRouteHandlerFn AppRouteHandlerFnContext AppRouterHandler AuthHandler diff --git a/docs/modules/helpers.html b/docs/modules/helpers.html index 3c276233b..6e703ed95 100644 --- a/docs/modules/helpers.html +++ b/docs/modules/helpers.html @@ -1,4 +1,4 @@ -helpers | @auth0/nextjs-auth0

        References

        AppRouteHandlerFn +helpers | @auth0/nextjs-auth0

        References

        AppRouteHandlerFn AppRouterPageRoute AppRouterPageRouteOpts GetServerSidePropsResultWithSession diff --git a/docs/modules/helpers_testing.html b/docs/modules/helpers_testing.html index 134ed3edd..777134f12 100644 --- a/docs/modules/helpers_testing.html +++ b/docs/modules/helpers_testing.html @@ -1,3 +1,3 @@ -helpers/testing | @auth0/nextjs-auth0

        Index

        Type Aliases

        GenerateSessionCookieConfig +helpers/testing | @auth0/nextjs-auth0
        \ No newline at end of file diff --git a/docs/modules/helpers_with_api_auth_required.html b/docs/modules/helpers_with_api_auth_required.html index 06228a1a5..13c06de37 100644 --- a/docs/modules/helpers_with_api_auth_required.html +++ b/docs/modules/helpers_with_api_auth_required.html @@ -1,4 +1,4 @@ -helpers/with-api-auth-required | @auth0/nextjs-auth0

        Module helpers/with-api-auth-required

        Index

        Server

        AppRouteHandlerFn +helpers/with-api-auth-required | @auth0/nextjs-auth0

        Module helpers/with-api-auth-required

        Index

        Server

        AppRouteHandlerFn AppRouteHandlerFnContext WithApiAuthRequired WithApiAuthRequiredAppRoute diff --git a/docs/modules/helpers_with_middleware_auth_required.html b/docs/modules/helpers_with_middleware_auth_required.html index 08c98686b..f61c6c13e 100644 --- a/docs/modules/helpers_with_middleware_auth_required.html +++ b/docs/modules/helpers_with_middleware_auth_required.html @@ -1,3 +1,3 @@ -helpers/with-middleware-auth-required | @auth0/nextjs-auth0

        Module helpers/with-middleware-auth-required

        Index

        Server

        WithMiddlewareAuthRequired +helpers/with-middleware-auth-required | @auth0/nextjs-auth0
        \ No newline at end of file diff --git a/docs/modules/helpers_with_page_auth_required.html b/docs/modules/helpers_with_page_auth_required.html index 5bdab4f95..a7a16cc60 100644 --- a/docs/modules/helpers_with_page_auth_required.html +++ b/docs/modules/helpers_with_page_auth_required.html @@ -1,4 +1,4 @@ -helpers/with-page-auth-required | @auth0/nextjs-auth0

        Module helpers/with-page-auth-required

        Index

        Server

        AppRouterPageRoute +helpers/with-page-auth-required | @auth0/nextjs-auth0

        Module helpers/with-page-auth-required

        Index

        Server

        AppRouterPageRoute AppRouterPageRouteOpts GetServerSidePropsResultWithSession PageRoute diff --git a/docs/modules/http.html b/docs/modules/http.html index de870ef4f..a98d2633a 100644 --- a/docs/modules/http.html +++ b/docs/modules/http.html @@ -1,4 +1,4 @@ -http | @auth0/nextjs-auth0

        References

        Auth0NextApiRequest +http | @auth0/nextjs-auth0

        References

        Auth0NextApiRequest Auth0NextApiResponse Auth0NextRequest Auth0NextRequestCookies diff --git a/docs/modules/http_auth0_next_api_request.html b/docs/modules/http_auth0_next_api_request.html index 01dc40313..b287330cf 100644 --- a/docs/modules/http_auth0_next_api_request.html +++ b/docs/modules/http_auth0_next_api_request.html @@ -1,2 +1,2 @@ -http/auth0-next-api-request | @auth0/nextjs-auth0

        Module http/auth0-next-api-request

        Index

        Classes

        default +http/auth0-next-api-request | @auth0/nextjs-auth0
        \ No newline at end of file diff --git a/docs/modules/http_auth0_next_api_response.html b/docs/modules/http_auth0_next_api_response.html index a48c43b91..74e9b9005 100644 --- a/docs/modules/http_auth0_next_api_response.html +++ b/docs/modules/http_auth0_next_api_response.html @@ -1,2 +1,2 @@ -http/auth0-next-api-response | @auth0/nextjs-auth0

        Module http/auth0-next-api-response

        Index

        Classes

        default +http/auth0-next-api-response | @auth0/nextjs-auth0
        \ No newline at end of file diff --git a/docs/modules/http_auth0_next_request.html b/docs/modules/http_auth0_next_request.html index a4d1c4871..5515b286b 100644 --- a/docs/modules/http_auth0_next_request.html +++ b/docs/modules/http_auth0_next_request.html @@ -1,2 +1,2 @@ -http/auth0-next-request | @auth0/nextjs-auth0

        Module http/auth0-next-request

        Index

        Classes

        default +http/auth0-next-request | @auth0/nextjs-auth0
        \ No newline at end of file diff --git a/docs/modules/http_auth0_next_request_cookies.html b/docs/modules/http_auth0_next_request_cookies.html index 25be92d33..944cb6dc7 100644 --- a/docs/modules/http_auth0_next_request_cookies.html +++ b/docs/modules/http_auth0_next_request_cookies.html @@ -1,2 +1,2 @@ -http/auth0-next-request-cookies | @auth0/nextjs-auth0

        Module http/auth0-next-request-cookies

        Index

        Classes

        default +http/auth0-next-request-cookies | @auth0/nextjs-auth0
        \ No newline at end of file diff --git a/docs/modules/http_auth0_next_response.html b/docs/modules/http_auth0_next_response.html index f8f12596b..a507a5d9c 100644 --- a/docs/modules/http_auth0_next_response.html +++ b/docs/modules/http_auth0_next_response.html @@ -1,2 +1,2 @@ -http/auth0-next-response | @auth0/nextjs-auth0

        Module http/auth0-next-response

        Index

        Classes

        default +http/auth0-next-response | @auth0/nextjs-auth0
        \ No newline at end of file diff --git a/docs/modules/http_auth0_next_response_cookies.html b/docs/modules/http_auth0_next_response_cookies.html index 35d9f767f..6a64d0685 100644 --- a/docs/modules/http_auth0_next_response_cookies.html +++ b/docs/modules/http_auth0_next_response_cookies.html @@ -1,2 +1,2 @@ -http/auth0-next-response-cookies | @auth0/nextjs-auth0

        Module http/auth0-next-response-cookies

        Index

        Classes

        default +http/auth0-next-response-cookies | @auth0/nextjs-auth0
        \ No newline at end of file diff --git a/docs/modules/index.html b/docs/modules/index.html index be62bf73f..27650f0e9 100644 --- a/docs/modules/index.html +++ b/docs/modules/index.html @@ -1,4 +1,4 @@ -index | @auth0/nextjs-auth0

        Other

        AccessTokenError +index | @auth0/nextjs-auth0

        Other

        AccessTokenError AccessTokenErrorCode AccessTokenRequest AfterCallback diff --git a/docs/modules/init.html b/docs/modules/init.html index 100380e77..47bb413b6 100644 --- a/docs/modules/init.html +++ b/docs/modules/init.html @@ -1,3 +1,3 @@ -init | @auth0/nextjs-auth0

        Index

        Other

        _initAuth +init | @auth0/nextjs-auth0
        \ No newline at end of file diff --git a/docs/modules/session.html b/docs/modules/session.html index b102ac782..d7cdcda2a 100644 --- a/docs/modules/session.html +++ b/docs/modules/session.html @@ -1,4 +1,4 @@ -session | @auth0/nextjs-auth0

        References

        AccessTokenRequest +session | @auth0/nextjs-auth0

        References

        AccessTokenRequest AfterRefresh AfterRefreshAppRoute AfterRefreshPageRoute diff --git a/docs/modules/session_get_access_token.html b/docs/modules/session_get_access_token.html index 24abdefa8..5cf0b14f9 100644 --- a/docs/modules/session_get_access_token.html +++ b/docs/modules/session_get_access_token.html @@ -1,4 +1,4 @@ -session/get-access-token | @auth0/nextjs-auth0

        Module session/get-access-token

        Index

        Server

        AccessTokenRequest +session/get-access-token | @auth0/nextjs-auth0

        Module session/get-access-token

        Index

        Server

        AccessTokenRequest GetAccessTokenResult AfterRefresh AfterRefreshAppRoute diff --git a/docs/modules/session_get_session.html b/docs/modules/session_get_session.html index bab40fbd8..ec1066e90 100644 --- a/docs/modules/session_get_session.html +++ b/docs/modules/session_get_session.html @@ -1,2 +1,2 @@ -session/get-session | @auth0/nextjs-auth0

        Module session/get-session

        Index

        Type Aliases

        GetSession +session/get-session | @auth0/nextjs-auth0
        \ No newline at end of file diff --git a/docs/modules/session_session.html b/docs/modules/session_session.html index 25b7cf3b1..33ba67c18 100644 --- a/docs/modules/session_session.html +++ b/docs/modules/session_session.html @@ -1,3 +1,3 @@ -session/session | @auth0/nextjs-auth0

        Index

        Server

        default +session/session | @auth0/nextjs-auth0
        \ No newline at end of file diff --git a/docs/modules/session_touch_session.html b/docs/modules/session_touch_session.html index d6e0f368b..3495ad3e5 100644 --- a/docs/modules/session_touch_session.html +++ b/docs/modules/session_touch_session.html @@ -1,2 +1,2 @@ -session/touch-session | @auth0/nextjs-auth0

        Module session/touch-session

        Index

        Type Aliases

        TouchSession +session/touch-session | @auth0/nextjs-auth0
        \ No newline at end of file diff --git a/docs/modules/session_update_session.html b/docs/modules/session_update_session.html index 082a358f3..79f1af269 100644 --- a/docs/modules/session_update_session.html +++ b/docs/modules/session_update_session.html @@ -1,2 +1,2 @@ -session/update-session | @auth0/nextjs-auth0

        Module session/update-session

        Index

        Type Aliases

        UpdateSession +session/update-session | @auth0/nextjs-auth0
        \ No newline at end of file diff --git a/docs/modules/shared.html b/docs/modules/shared.html index 768c676fc..945e58838 100644 --- a/docs/modules/shared.html +++ b/docs/modules/shared.html @@ -1,4 +1,4 @@ -shared | @auth0/nextjs-auth0

        Other

        AccessTokenError +shared | @auth0/nextjs-auth0

        Other

        AccessTokenError AccessTokenErrorCode AccessTokenRequest AfterCallback diff --git a/docs/modules/utils_errors.html b/docs/modules/utils_errors.html index 9406f5cb6..298f0cc7a 100644 --- a/docs/modules/utils_errors.html +++ b/docs/modules/utils_errors.html @@ -1,4 +1,4 @@ -utils/errors | @auth0/nextjs-auth0

        Index

        Server

        AccessTokenErrorCode +utils/errors | @auth0/nextjs-auth0

        Index

        Server

        AccessTokenErrorCode AccessTokenError AuthError CallbackHandlerError diff --git a/docs/modules/version.html b/docs/modules/version.html index 295b77c86..0f86f7587 100644 --- a/docs/modules/version.html +++ b/docs/modules/version.html @@ -1,2 +1,2 @@ -version | @auth0/nextjs-auth0

        Index

        Variables

        default +version | @auth0/nextjs-auth0
        \ No newline at end of file diff --git a/docs/types/client_use_user.UserContext.html b/docs/types/client_use_user.UserContext.html index 8fd622e01..266d7d127 100644 --- a/docs/types/client_use_user.UserContext.html +++ b/docs/types/client_use_user.UserContext.html @@ -1,2 +1,2 @@ UserContext | @auth0/nextjs-auth0
        UserContext: {
            checkSession: (() => Promise<void>);
            error?: Error;
            isLoading: boolean;
            user?: UserProfile;
        }

        The user context returned from the useUser hook.

        -

        Type declaration

        • checkSession: (() => Promise<void>)
            • (): Promise<void>
            • Returns Promise<void>

        • Optional error?: Error
        • isLoading: boolean
        • Optional user?: UserProfile
        \ No newline at end of file +

        Type declaration

        • checkSession: (() => Promise<void>)
            • (): Promise<void>
            • Returns Promise<void>

        • Optional error?: Error
        • isLoading: boolean
        • Optional user?: UserProfile
        \ No newline at end of file diff --git a/docs/types/client_use_user.UserProvider.html b/docs/types/client_use_user.UserProvider.html index 9546049bb..4b8830ea5 100644 --- a/docs/types/client_use_user.UserProvider.html +++ b/docs/types/client_use_user.UserProvider.html @@ -1,2 +1,2 @@ UserProvider | @auth0/nextjs-auth0
        UserProvider: ((props) => ReactElement<UserContext>)

        Type declaration

          • (props): ReactElement<UserContext>
          • To use the useUser hook, you must wrap your application in a <UserProvider> component.

            -

            Parameters

            Returns ReactElement<UserContext>

        \ No newline at end of file +

        Parameters

        Returns ReactElement<UserContext>

        \ No newline at end of file diff --git a/docs/types/client_use_user.UserProviderProps.html b/docs/types/client_use_user.UserProviderProps.html index 233b631a1..393e8b509 100644 --- a/docs/types/client_use_user.UserProviderProps.html +++ b/docs/types/client_use_user.UserProviderProps.html @@ -13,4 +13,4 @@ fetcher option.

        IMPORTANT If you have used a custom url for your HandleProfile API route handler (the default is /api/auth/me) then you need to specify it here in the profileUrl option.

        -
        \ No newline at end of file +
        \ No newline at end of file diff --git a/docs/types/client_with_page_auth_required.WithPageAuthRequired.html b/docs/types/client_with_page_auth_required.WithPageAuthRequired.html index 0c1fccde9..4c05e823f 100644 --- a/docs/types/client_with_page_auth_required.WithPageAuthRequired.html +++ b/docs/types/client_with_page_auth_required.WithPageAuthRequired.html @@ -2,4 +2,4 @@

        When you wrap your pages in this higher order component and an anonymous user visits your page, they will be redirected to the login page and then returned to the page they were redirected from (after login).

        -

        Type Parameters

        • P extends {}

        Parameters

        Returns React.FC<P>

        \ No newline at end of file +

        Type Parameters

        • P extends {}

        Parameters

        Returns React.FC<P>

        \ No newline at end of file diff --git a/docs/types/config.ConfigParameters.html b/docs/types/config.ConfigParameters.html index 6a916204c..96455de47 100644 --- a/docs/types/config.ConfigParameters.html +++ b/docs/types/config.ConfigParameters.html @@ -59,4 +59,4 @@ instance of the SDK. Also note - this is for the server side part of the SDK - you will always use named exports for the front end components: UserProvider, UseUser and the front end version of WithPageAuthRequired

        -
        \ No newline at end of file +
        \ No newline at end of file diff --git a/docs/types/config.GetConfig.html b/docs/types/config.GetConfig.html index 023f4c7ef..49ba16d82 100644 --- a/docs/types/config.GetConfig.html +++ b/docs/types/config.GetConfig.html @@ -1 +1 @@ -GetConfig | @auth0/nextjs-auth0
        \ No newline at end of file +GetConfig | @auth0/nextjs-auth0
        \ No newline at end of file diff --git a/docs/types/edge.InitAuth0.html b/docs/types/edge.InitAuth0.html index 5b6d4bd58..bc0e4bc0a 100644 --- a/docs/types/edge.InitAuth0.html +++ b/docs/types/edge.InitAuth0.html @@ -1,3 +1,3 @@ InitAuth0 | @auth0/nextjs-auth0
        \ No newline at end of file +

        Parameters

        Returns Auth0Server

        \ No newline at end of file diff --git a/docs/types/handlers_auth.AppRouterOnError.html b/docs/types/handlers_auth.AppRouterOnError.html index f4caca6f6..3dd1547cc 100644 --- a/docs/types/handlers_auth.AppRouterOnError.html +++ b/docs/types/handlers_auth.AppRouterOnError.html @@ -1 +1 @@ -AppRouterOnError | @auth0/nextjs-auth0
        AppRouterOnError: ((req, error) => Promise<Response | void> | Response | void)

        Type declaration

          • (req, error): Promise<Response | void> | Response | void
          • Parameters

            Returns Promise<Response | void> | Response | void

        \ No newline at end of file +AppRouterOnError | @auth0/nextjs-auth0
        AppRouterOnError: ((req, error) => Promise<Response | void> | Response | void)

        Type declaration

          • (req, error): Promise<Response | void> | Response | void
          • Parameters

            Returns Promise<Response | void> | Response | void

        \ No newline at end of file diff --git a/docs/types/handlers_auth.HandleAuth.html b/docs/types/handlers_auth.HandleAuth.html index 411843387..983ebfda5 100644 --- a/docs/types/handlers_auth.HandleAuth.html +++ b/docs/types/handlers_auth.HandleAuth.html @@ -9,11 +9,11 @@ app/api/auth/[auth0]/route.js. For example:

        // app/api/auth/[auth0]/route.js
        import { handleAuth } from '@auth0/nextjs-auth0';

        export const GET = handleAuth();
        -

        This will create 5 handlers for the following urls:

        +

        This will create 4 handlers for the following urls:

        • /api/auth/login: log the user in to your app by redirecting them to your identity provider.
        • /api/auth/callback: The page that your identity provider will redirect the user back to on login.
        • /api/auth/logout: log the user out of your app.
        • /api/auth/me: View the user profile JSON (used by the UseUser hook).
        -

        Parameters

        Returns NextApiHandler | AppRouteHandlerFn | any

        \ No newline at end of file +

        Parameters

        Returns NextApiHandler | AppRouteHandlerFn | any

        \ No newline at end of file diff --git a/docs/types/handlers_auth.Handlers.html b/docs/types/handlers_auth.Handlers.html index fb809fa43..48b565f99 100644 --- a/docs/types/handlers_auth.Handlers.html +++ b/docs/types/handlers_auth.Handlers.html @@ -8,4 +8,4 @@

        You can also create new handlers by customizing the default ones. For example:

        // pages/api/auth/[auth0].js
        import { handleAuth, handleLogin } from '@auth0/nextjs-auth0';

        export default handleAuth({
        signup: handleLogin({
        authorizationParams: { screen_hint: 'signup' }
        })
        });
        -
        \ No newline at end of file +
        \ No newline at end of file diff --git a/docs/types/handlers_auth.PageRouterOnError.html b/docs/types/handlers_auth.PageRouterOnError.html index 1209382a0..62073abde 100644 --- a/docs/types/handlers_auth.PageRouterOnError.html +++ b/docs/types/handlers_auth.PageRouterOnError.html @@ -2,4 +2,4 @@

        Use this to define an error handler for all the default routes in a single place. For example:

        export default handleAuth({
        onError(req, res, error) {
        errorLogger(error);
        // You can finish the response yourself if you want to customize
        // the status code or redirect the user
        // res.writeHead(302, {
        // Location: '/custom-error-page'
        // });
        // res.end();
        }
        });
        -

        Parameters

        Returns Promise<void> | void

        \ No newline at end of file +

        Parameters

        Returns Promise<void> | void

        \ No newline at end of file diff --git a/docs/types/handlers_backchannel_logout.HandleBackchannelLogout.html b/docs/types/handlers_backchannel_logout.HandleBackchannelLogout.html index 96f556ee3..55d7aba80 100644 --- a/docs/types/handlers_backchannel_logout.HandleBackchannelLogout.html +++ b/docs/types/handlers_backchannel_logout.HandleBackchannelLogout.html @@ -1,2 +1,2 @@ HandleBackchannelLogout | @auth0/nextjs-auth0
        \ No newline at end of file +
        \ No newline at end of file diff --git a/docs/types/handlers_callback.AfterCallback.html b/docs/types/handlers_callback.AfterCallback.html index c6e117368..3e226c258 100644 --- a/docs/types/handlers_callback.AfterCallback.html +++ b/docs/types/handlers_callback.AfterCallback.html @@ -1,2 +1,2 @@ AfterCallback | @auth0/nextjs-auth0
        \ No newline at end of file +
        \ No newline at end of file diff --git a/docs/types/handlers_callback.AfterCallbackAppRoute.html b/docs/types/handlers_callback.AfterCallbackAppRoute.html index 4d2bed54f..c2f5707c8 100644 --- a/docs/types/handlers_callback.AfterCallbackAppRoute.html +++ b/docs/types/handlers_callback.AfterCallbackAppRoute.html @@ -1,13 +1,10 @@ AfterCallbackAppRoute | @auth0/nextjs-auth0
        AfterCallbackAppRoute: ((req, session, state?) => Promise<default | Response | undefined> | default | Response | undefined)

        Type declaration

          • (req, session, state?): Promise<default | Response | undefined> | default | Response | undefined
          • Use this function for validating additional claims on the user's ID token or adding removing items from the session after login.

            -

            Parameters

            • req: NextRequest
            • session: default
            • Optional state: {
                  [key: string]: any;
              }
              • [key: string]: any

            Returns Promise<default | Response | undefined> | default | Response | undefined

            Example

            Validate additional claims

            -
            // app/api/auth/[auth0]/route.js
            import { handleAuth, handleCallback } from '@auth0/nextjs-auth0';
            import { redirect } from 'next/navigation';

            const afterCallback = (req, session, state) => {
            if (session.user.isAdmin) {
            return session;
            } else {
            redirect('/unauthorized');
            }
            };

            export default handleAuth({
            callback: handleCallback({ afterCallback })
            }); +

            Parameters

            • req: NextRequest
            • session: default
            • Optional state: {
                  [key: string]: any;
              }
              • [key: string]: any

            Returns Promise<default | Response | undefined> | default | Response | undefined

            Example: Validate additional claims

            // app/api/auth/[auth0]/route.js
            import { handleAuth, handleCallback } from '@auth0/nextjs-auth0';
            import { NextResponse } from 'next/server';

            const afterCallback = (req, session) => {
            if (session.user.isAdmin) {
            return session;
            }
            };

            export const GET = handleAuth({
            async callback(req, ctx) {
            const res = await handleCallback(req, ctx, { afterCallback });
            const session = await getSession(req, res);
            if (!session) {
            return NextResponse.redirect(`${process.env.AUTH0_BASE_URL}/fail`, res);
            }
            return res;
            },
            });
            -

            Example

            Modify the session after login

            -
            // pages/api/auth/[auth0].js
            import { handleAuth, handleCallback } from '@auth0/nextjs-auth0';
            import { NextResponse } from 'next/server';

            const afterCallback = (req, session, state) => {
            session.user.customProperty = 'foo';
            delete session.refreshToken;
            return session;
            };

            export default handleAuth({
            callback: handleCallback({ afterCallback })
            }); +

            Example: Modify the session after login

            // pages/api/auth/[auth0].js
            import { handleAuth, handleCallback } from '@auth0/nextjs-auth0';
            import { NextResponse } from 'next/server';

            const afterCallback = (req, session, state) => {
            session.user.customProperty = 'foo';
            delete session.refreshToken;
            return session;
            };

            export const GET = handleAuth({
            callback: handleCallback({ afterCallback })
            });
            -

            Example

            Redirect successful login based on claim

            -
            // pages/api/auth/[auth0].js
            import { handleAuth, handleCallback } from '@auth0/nextjs-auth0';
            import { headers } from 'next/headers';

            const afterCallback = (req, session, state) => {
            if (!session.user.isAdmin) {
            headers.set('location', '/admin');
            }
            return session;
            };

            export default handleAuth({
            callback: handleCallback({ afterCallback })
            }); +

            Example: Redirect successful login based on claim (afterCallback is not required).

            // pages/api/auth/[auth0].js
            import { handleAuth, handleCallback } from '@auth0/nextjs-auth0';
            import { NextResponse } from 'next/server';

            export const GET = handleAuth({
            async callback(req, ctx) {
            const res = await handleCallback(req, ctx);
            const session = await getSession(req, res);
            if (session?.user.isAdmin) {
            return NextResponse.redirect(`${process.env.AUTH0_BASE_URL}/admin`, res);
            }
            return res;
            },
            });

            Throws

            HandlerError

            -
        \ No newline at end of file +
        \ No newline at end of file diff --git a/docs/types/handlers_callback.AfterCallbackPageRoute.html b/docs/types/handlers_callback.AfterCallbackPageRoute.html index 1c3f5ae56..7208e11db 100644 --- a/docs/types/handlers_callback.AfterCallbackPageRoute.html +++ b/docs/types/handlers_callback.AfterCallbackPageRoute.html @@ -1,13 +1,10 @@ AfterCallbackPageRoute | @auth0/nextjs-auth0
        AfterCallbackPageRoute: ((req, res, session, state?) => Promise<default | undefined> | default | undefined)

        Type declaration

          • (req, res, session, state?): Promise<default | undefined> | default | undefined
          • Use this function for validating additional claims on the user's ID token or adding removing items from the session after login.

            -

            Parameters

            • req: NextApiRequest
            • res: NextApiResponse
            • session: default
            • Optional state: {
                  [key: string]: any;
              }
              • [key: string]: any

            Returns Promise<default | undefined> | default | undefined

            Example

            Validate additional claims

            -
            // pages/api/auth/[auth0].js
            import { handleAuth, handleCallback } from '@auth0/nextjs-auth0';

            const afterCallback = (req, res, session, state) => {
            if (session.user.isAdmin) {
            return session;
            } else {
            res.status(401).end('User is not admin');
            }
            };

            export default handleAuth({
            async callback(req, res) {
            try {
            await handleCallback(req, res, { afterCallback });
            } catch (error) {
            res.status(error.status || 500).end();
            }
            }
            }); +

            Parameters

            • req: NextApiRequest
            • res: NextApiResponse
            • session: default
            • Optional state: {
                  [key: string]: any;
              }
              • [key: string]: any

            Returns Promise<default | undefined> | default | undefined

            Example: Validate additional claims

            // pages/api/auth/[auth0].js
            import { handleAuth, handleCallback } from '@auth0/nextjs-auth0';

            const afterCallback = (req, res, session, state) => {
            if (session.user.isAdmin) {
            return session;
            } else {
            res.status(401).end('User is not admin');
            }
            };

            export default handleAuth({
            async callback(req, res) {
            try {
            await handleCallback(req, res, { afterCallback });
            } catch (error) {
            res.status(error.status || 500).end();
            }
            }
            });
            -

            Example

            Modify the session after login

            -
            // pages/api/auth/[auth0].js
            import { handleAuth, handleCallback } from '@auth0/nextjs-auth0';

            const afterCallback = (req, res, session, state) => {
            session.user.customProperty = 'foo';
            delete session.refreshToken;
            return session;
            };

            export default handleAuth({
            async callback(req, res) {
            try {
            await handleCallback(req, res, { afterCallback });
            } catch (error) {
            res.status(error.status || 500).end();
            }
            }
            }); +

            Example: Modify the session after login

            // pages/api/auth/[auth0].js
            import { handleAuth, handleCallback } from '@auth0/nextjs-auth0';

            const afterCallback = (req, res, session, state) => {
            session.user.customProperty = 'foo';
            delete session.refreshToken;
            return session;
            };

            export default handleAuth({
            async callback(req, res) {
            try {
            await handleCallback(req, res, { afterCallback });
            } catch (error) {
            res.status(error.status || 500).end();
            }
            }
            });
            -

            Example

            Redirect successful login based on claim

            -
            // pages/api/auth/[auth0].js
            import { handleAuth, handleCallback } from '@auth0/nextjs-auth0';

            const afterCallback = (req, res, session, state) => {
            if (!session.user.isAdmin) {
            res.setHeader('Location', '/admin');
            }
            return session;
            };

            export default handleAuth({
            async callback(req, res) {
            try {
            await handleCallback(req, res, { afterCallback });
            } catch (error) {
            res.status(error.status || 500).end(error.message);
            }
            }
            }); +

            Example: Redirect successful login based on claim

            // pages/api/auth/[auth0].js
            import { handleAuth, handleCallback } from '@auth0/nextjs-auth0';

            const afterCallback = (req, res, session, state) => {
            if (!session.user.isAdmin) {
            res.setHeader('Location', '/admin');
            }
            return session;
            };

            export default handleAuth({
            async callback(req, res) {
            try {
            await handleCallback(req, res, { afterCallback });
            } catch (error) {
            res.status(error.status || 500).end(error.message);
            }
            }
            });

            Throws

            HandlerError

            -
        \ No newline at end of file +
        \ No newline at end of file diff --git a/docs/types/handlers_callback.CallbackHandler.html b/docs/types/handlers_callback.CallbackHandler.html index 728a0354c..10d0244e0 100644 --- a/docs/types/handlers_callback.CallbackHandler.html +++ b/docs/types/handlers_callback.CallbackHandler.html @@ -1,3 +1,3 @@ CallbackHandler | @auth0/nextjs-auth0
        \ No newline at end of file +
        \ No newline at end of file diff --git a/docs/types/handlers_callback.CallbackOptionsProvider.html b/docs/types/handlers_callback.CallbackOptionsProvider.html index 2bcb64296..e5b16613d 100644 --- a/docs/types/handlers_callback.CallbackOptionsProvider.html +++ b/docs/types/handlers_callback.CallbackOptionsProvider.html @@ -1,3 +1,3 @@ CallbackOptionsProvider | @auth0/nextjs-auth0
        \ No newline at end of file +
        \ No newline at end of file diff --git a/docs/types/handlers_callback.HandleCallback.html b/docs/types/handlers_callback.HandleCallback.html index 57c565889..70cc98ecf 100644 --- a/docs/types/handlers_callback.HandleCallback.html +++ b/docs/types/handlers_callback.HandleCallback.html @@ -1,13 +1,10 @@ HandleCallback | @auth0/nextjs-auth0
        HandleCallback: AuthHandler<CallbackOptions>

        Use this to customize the default callback handler without overriding it. You can still override the handler if needed.

        -

        Example

        Pass an options object

        -
        // pages/api/auth/[auth0].js
        import { handleAuth, handleCallback } from '@auth0/nextjs-auth0';

        export default handleAuth({
        callback: handleCallback({ redirectUri: 'https://example.com' })
        }); +

        Example: Pass an options object

        // pages/api/auth/[auth0].js
        import { handleAuth, handleCallback } from '@auth0/nextjs-auth0';

        export default handleAuth({
        callback: handleCallback({ redirectUri: 'https://example.com' })
        });
        -

        Example

        Pass a function that receives the request and returns an options object

        -
        // pages/api/auth/[auth0].js
        import { handleAuth, handleCallback } from '@auth0/nextjs-auth0';

        export default handleAuth({
        callback: handleCallback((req) => {
        return { redirectUri: 'https://example.com' };
        })
        }); +

        Example: Pass a function that receives the request and returns an options object

        // pages/api/auth/[auth0].js
        import { handleAuth, handleCallback } from '@auth0/nextjs-auth0';

        export default handleAuth({
        callback: handleCallback((req) => {
        return { redirectUri: 'https://example.com' };
        })
        });

        This is useful for generating options that depend on values from the request.

        -

        Example

        Override the callback handler

        -
        import { handleAuth, handleCallback } from '@auth0/nextjs-auth0';

        export default handleAuth({
        callback: async (req, res) => {
        try {
        await handleCallback(req, res, {
        redirectUri: 'https://example.com'
        });
        } catch (error) {
        console.error(error);
        }
        }
        }); +

        Example: Override the callback handler

        import { handleAuth, handleCallback } from '@auth0/nextjs-auth0';

        export default handleAuth({
        callback: async (req, res) => {
        try {
        await handleCallback(req, res, {
        redirectUri: 'https://example.com'
        });
        } catch (error) {
        console.error(error);
        }
        }
        });
        -
        \ No newline at end of file +
        \ No newline at end of file diff --git a/docs/types/handlers_login.GetLoginState.html b/docs/types/handlers_login.GetLoginState.html index 747ed1cad..658580dcb 100644 --- a/docs/types/handlers_login.GetLoginState.html +++ b/docs/types/handlers_login.GetLoginState.html @@ -1,2 +1,2 @@ GetLoginState | @auth0/nextjs-auth0
        \ No newline at end of file +
        \ No newline at end of file diff --git a/docs/types/handlers_login.GetLoginStateAppRoute.html b/docs/types/handlers_login.GetLoginStateAppRoute.html index 262c6fbeb..e080d8554 100644 --- a/docs/types/handlers_login.GetLoginStateAppRoute.html +++ b/docs/types/handlers_login.GetLoginStateAppRoute.html @@ -1,4 +1,4 @@ GetLoginStateAppRoute | @auth0/nextjs-auth0
        GetLoginStateAppRoute: ((req, options) => {
            [key: string]: any;
        })

        Type declaration

          • (req, options): {
                [key: string]: any;
            }
          • Use this to store additional state for the user before they visit the identity provider to log in.

            // app/api/auth/[auth0]/route.js
            import { handleAuth, handleLogin } from '@auth0/nextjs-auth0';

            const getLoginState = (req, loginOptions) => {
            return { basket_id: getBasketId(req) };
            };

            export default handleAuth({
            login: handleLogin({ getLoginState })
            });
            -

            Parameters

            Returns {
                [key: string]: any;
            }

            • [key: string]: any
        \ No newline at end of file +

        Parameters

        Returns {
            [key: string]: any;
        }

        • [key: string]: any
        \ No newline at end of file diff --git a/docs/types/handlers_login.GetLoginStatePageRoute.html b/docs/types/handlers_login.GetLoginStatePageRoute.html index be4247a1b..7a9f8a05e 100644 --- a/docs/types/handlers_login.GetLoginStatePageRoute.html +++ b/docs/types/handlers_login.GetLoginStatePageRoute.html @@ -1,4 +1,4 @@ GetLoginStatePageRoute | @auth0/nextjs-auth0
        GetLoginStatePageRoute: ((req, options) => {
            [key: string]: any;
        })

        Type declaration

          • (req, options): {
                [key: string]: any;
            }
          • Use this to store additional state for the user before they visit the identity provider to log in.

            // pages/api/auth/[auth0].js
            import { handleAuth, handleLogin } from '@auth0/nextjs-auth0';

            const getLoginState = (req, loginOptions) => {
            return { basket_id: getBasketId(req) };
            };

            export default handleAuth({
            login: handleLogin({ getLoginState })
            });
            -

            Parameters

            Returns {
                [key: string]: any;
            }

            • [key: string]: any
        \ No newline at end of file +

        Parameters

        Returns {
            [key: string]: any;
        }

        • [key: string]: any
        \ No newline at end of file diff --git a/docs/types/handlers_login.HandleLogin.html b/docs/types/handlers_login.HandleLogin.html index 378484331..d75141f78 100644 --- a/docs/types/handlers_login.HandleLogin.html +++ b/docs/types/handlers_login.HandleLogin.html @@ -1,13 +1,10 @@ HandleLogin | @auth0/nextjs-auth0

        Use this to customize the default login handler without overriding it. You can still override the handler if needed.

        -

        Example

        Pass an options object

        -
        // pages/api/auth/[auth0].js
        import { handleAuth, handleLogin } from '@auth0/nextjs-auth0';

        export default handleAuth({
        login: handleLogin({
        authorizationParams: { connection: 'github' }
        })
        }); +

        Example: Pass an options object

        // pages/api/auth/[auth0].js
        import { handleAuth, handleLogin } from '@auth0/nextjs-auth0';

        export default handleAuth({
        login: handleLogin({
        authorizationParams: { connection: 'github' }
        })
        });
        -

        Example

        Pass a function that receives the request and returns an options object

        -
        // pages/api/auth/[auth0].js
        import { handleAuth, handleLogin } from '@auth0/nextjs-auth0';

        export default handleAuth({
        login: handleLogin((req) => {
        return {
        authorizationParams: { connection: 'github' }
        };
        })
        }); +

        Example: Pass a function that receives the request and returns an options object

        // pages/api/auth/[auth0].js
        import { handleAuth, handleLogin } from '@auth0/nextjs-auth0';

        export default handleAuth({
        login: handleLogin((req) => {
        return {
        authorizationParams: { connection: 'github' }
        };
        })
        });

        This is useful for generating options that depend on values from the request.

        -

        Example

        Override the login handler

        -
        import { handleAuth, handleLogin } from '@auth0/nextjs-auth0';

        export default handleAuth({
        login: async (req, res) => {
        try {
        await handleLogin(req, res, {
        authorizationParams: { connection: 'github' }
        });
        } catch (error) {
        console.error(error);
        }
        }
        }); +

        Example: Override the login handler

        import { handleAuth, handleLogin } from '@auth0/nextjs-auth0';

        export default handleAuth({
        login: async (req, res) => {
        try {
        await handleLogin(req, res, {
        authorizationParams: { connection: 'github' }
        });
        } catch (error) {
        console.error(error);
        }
        }
        });
        -
        \ No newline at end of file +
        \ No newline at end of file diff --git a/docs/types/handlers_login.LoginHandler.html b/docs/types/handlers_login.LoginHandler.html index 6d11ea4f2..12cc37d4f 100644 --- a/docs/types/handlers_login.LoginHandler.html +++ b/docs/types/handlers_login.LoginHandler.html @@ -1,3 +1,3 @@ LoginHandler | @auth0/nextjs-auth0
        \ No newline at end of file +
        \ No newline at end of file diff --git a/docs/types/handlers_login.LoginOptionsProvider.html b/docs/types/handlers_login.LoginOptionsProvider.html index 2b31e9ff3..9ff0ceee1 100644 --- a/docs/types/handlers_login.LoginOptionsProvider.html +++ b/docs/types/handlers_login.LoginOptionsProvider.html @@ -1,3 +1,3 @@ LoginOptionsProvider | @auth0/nextjs-auth0
        \ No newline at end of file +
        \ No newline at end of file diff --git a/docs/types/handlers_logout.HandleLogout.html b/docs/types/handlers_logout.HandleLogout.html index 0e8fd6fb9..04745dde3 100644 --- a/docs/types/handlers_logout.HandleLogout.html +++ b/docs/types/handlers_logout.HandleLogout.html @@ -1,13 +1,10 @@ HandleLogout | @auth0/nextjs-auth0
        HandleLogout: AuthHandler<LogoutOptions>

        Use this to customize the default logout handler without overriding it. You can still override the handler if needed.

        -

        Example

        Pass an options object

        -
        // pages/api/auth/[auth0].js
        import { handleAuth, handleLogout } from '@auth0/nextjs-auth0';

        export default handleAuth({
        logout: handleLogout({ returnTo: 'https://example.com' })
        }); +

        Example: Pass an options object

        // pages/api/auth/[auth0].js
        import { handleAuth, handleLogout } from '@auth0/nextjs-auth0';

        export default handleAuth({
        logout: handleLogout({ returnTo: 'https://example.com' })
        });
        -

        Example

        Pass a function that receives the request and returns an options object

        -
        // pages/api/auth/[auth0].js
        import { handleAuth, handleLogout } from '@auth0/nextjs-auth0';

        export default handleAuth({
        logout: handleLogout((req) => {
        return { returnTo: 'https://example.com' };
        })
        }); +

        Example: Pass a function that receives the request and returns an options object

        // pages/api/auth/[auth0].js
        import { handleAuth, handleLogout } from '@auth0/nextjs-auth0';

        export default handleAuth({
        logout: handleLogout((req) => {
        return { returnTo: 'https://example.com' };
        })
        });

        This is useful for generating options that depend on values from the request.

        -

        Example

        Override the logout handler

        -
        import { handleAuth, handleLogout } from '@auth0/nextjs-auth0';

        export default handleAuth({
        logout: async (req, res) => {
        try {
        await handleLogout(req, res, {
        returnTo: 'https://example.com'
        });
        } catch (error) {
        console.error(error);
        }
        }
        }); +

        Example: Override the logout handler

        import { handleAuth, handleLogout } from '@auth0/nextjs-auth0';

        export default handleAuth({
        logout: async (req, res) => {
        try {
        await handleLogout(req, res, {
        returnTo: 'https://example.com'
        });
        } catch (error) {
        console.error(error);
        }
        }
        });
        -
        \ No newline at end of file +
        \ No newline at end of file diff --git a/docs/types/handlers_logout.LogoutHandler.html b/docs/types/handlers_logout.LogoutHandler.html index 3f12a473c..c4fc022d6 100644 --- a/docs/types/handlers_logout.LogoutHandler.html +++ b/docs/types/handlers_logout.LogoutHandler.html @@ -1,3 +1,3 @@ LogoutHandler | @auth0/nextjs-auth0
        \ No newline at end of file +
        \ No newline at end of file diff --git a/docs/types/handlers_logout.LogoutOptionsProvider.html b/docs/types/handlers_logout.LogoutOptionsProvider.html index fa57ac17e..cf8884759 100644 --- a/docs/types/handlers_logout.LogoutOptionsProvider.html +++ b/docs/types/handlers_logout.LogoutOptionsProvider.html @@ -1,3 +1,3 @@ LogoutOptionsProvider | @auth0/nextjs-auth0
        \ No newline at end of file +
        \ No newline at end of file diff --git a/docs/types/handlers_profile.AfterRefetch.html b/docs/types/handlers_profile.AfterRefetch.html index f048ff0a1..b25ef7282 100644 --- a/docs/types/handlers_profile.AfterRefetch.html +++ b/docs/types/handlers_profile.AfterRefetch.html @@ -1,2 +1,2 @@ AfterRefetch | @auth0/nextjs-auth0
        \ No newline at end of file +
        \ No newline at end of file diff --git a/docs/types/handlers_profile.AfterRefetchAppRoute.html b/docs/types/handlers_profile.AfterRefetchAppRoute.html index 98ea64cab..af9ef3e63 100644 --- a/docs/types/handlers_profile.AfterRefetchAppRoute.html +++ b/docs/types/handlers_profile.AfterRefetchAppRoute.html @@ -1,2 +1,2 @@ AfterRefetchAppRoute | @auth0/nextjs-auth0
        \ No newline at end of file +

        Parameters

        Returns Promise<default> | default

        \ No newline at end of file diff --git a/docs/types/handlers_profile.AfterRefetchPageRoute.html b/docs/types/handlers_profile.AfterRefetchPageRoute.html index bedefcd8c..3e9cdbe59 100644 --- a/docs/types/handlers_profile.AfterRefetchPageRoute.html +++ b/docs/types/handlers_profile.AfterRefetchPageRoute.html @@ -1,2 +1,2 @@ AfterRefetchPageRoute | @auth0/nextjs-auth0
        \ No newline at end of file +

        Parameters

        • req: NextApiRequest
        • res: NextApiResponse
        • session: default

        Returns Promise<default> | default

        \ No newline at end of file diff --git a/docs/types/handlers_profile.HandleProfile.html b/docs/types/handlers_profile.HandleProfile.html index 26a5d4b6b..cf554adf0 100644 --- a/docs/types/handlers_profile.HandleProfile.html +++ b/docs/types/handlers_profile.HandleProfile.html @@ -1,13 +1,10 @@ HandleProfile | @auth0/nextjs-auth0
        HandleProfile: AuthHandler<ProfileOptions>

        Use this to customize the default profile handler without overriding it. You can still override the handler if needed.

        -

        Example

        Pass an options object

        -
        // pages/api/auth/[auth0].js
        import { handleAuth, handleProfile } from '@auth0/nextjs-auth0';

        export default handleAuth({
        profile: handleProfile({ refetch: true })
        }); +

        Example: Pass an options object

        // pages/api/auth/[auth0].js
        import { handleAuth, handleProfile } from '@auth0/nextjs-auth0';

        export default handleAuth({
        profile: handleProfile({ refetch: true })
        });
        -

        Example

        Pass a function that receives the request and returns an options object

        -
        // pages/api/auth/[auth0].js
        import { handleAuth, handleProfile } from '@auth0/nextjs-auth0';

        export default handleAuth({
        profile: handleProfile((req) => {
        return { refetch: true };
        })
        }); +

        Example: Pass a function that receives the request and returns an options object

        // pages/api/auth/[auth0].js
        import { handleAuth, handleProfile } from '@auth0/nextjs-auth0';

        export default handleAuth({
        profile: handleProfile((req) => {
        return { refetch: true };
        })
        });

        This is useful for generating options that depend on values from the request.

        -

        Example

        Override the profile handler

        -
        import { handleAuth, handleProfile } from '@auth0/nextjs-auth0';

        export default handleAuth({
        profile: async (req, res) => {
        try {
        await handleProfile(req, res, { refetch: true });
        } catch (error) {
        console.error(error);
        }
        }
        }); +

        Example: Override the profile handler

        import { handleAuth, handleProfile } from '@auth0/nextjs-auth0';

        export default handleAuth({
        profile: async (req, res) => {
        try {
        await handleProfile(req, res, { refetch: true });
        } catch (error) {
        console.error(error);
        }
        }
        });
        -
        \ No newline at end of file +
        \ No newline at end of file diff --git a/docs/types/handlers_profile.ProfileHandler.html b/docs/types/handlers_profile.ProfileHandler.html index 579f58960..e51878a1d 100644 --- a/docs/types/handlers_profile.ProfileHandler.html +++ b/docs/types/handlers_profile.ProfileHandler.html @@ -1,3 +1,3 @@ ProfileHandler | @auth0/nextjs-auth0
        \ No newline at end of file +
        \ No newline at end of file diff --git a/docs/types/handlers_profile.ProfileOptions.html b/docs/types/handlers_profile.ProfileOptions.html index e0f31a3b1..603b025de 100644 --- a/docs/types/handlers_profile.ProfileOptions.html +++ b/docs/types/handlers_profile.ProfileOptions.html @@ -5,4 +5,4 @@
      • Optional refetch?: boolean

        If set to true this will refetch the user profile information from /userinfo and save it to the session.

      • \ No newline at end of file +
        \ No newline at end of file diff --git a/docs/types/handlers_profile.ProfileOptionsProvider.html b/docs/types/handlers_profile.ProfileOptionsProvider.html index 1a118c076..ae1a6bb45 100644 --- a/docs/types/handlers_profile.ProfileOptionsProvider.html +++ b/docs/types/handlers_profile.ProfileOptionsProvider.html @@ -1,3 +1,3 @@ ProfileOptionsProvider | @auth0/nextjs-auth0
        \ No newline at end of file +
        \ No newline at end of file diff --git a/docs/types/handlers_router_helpers.AppRouteHandlerFn.html b/docs/types/handlers_router_helpers.AppRouteHandlerFn.html index 7925f601f..4a72ffbe2 100644 --- a/docs/types/handlers_router_helpers.AppRouteHandlerFn.html +++ b/docs/types/handlers_router_helpers.AppRouteHandlerFn.html @@ -1,2 +1,2 @@ AppRouteHandlerFn | @auth0/nextjs-auth0
        AppRouteHandlerFn<Options>: ((req, ctx, opts?) => Promise<Response> | Response)

        Type Parameters

        • Options = any

        Type declaration

          • (req, ctx, opts?): Promise<Response> | Response
          • Handler function for app routes.

            -

            Parameters

            Returns Promise<Response> | Response

        \ No newline at end of file +

        Parameters

        Returns Promise<Response> | Response

        \ No newline at end of file diff --git a/docs/types/handlers_router_helpers.AppRouteHandlerFnContext.html b/docs/types/handlers_router_helpers.AppRouteHandlerFnContext.html index 5fc8cc8a3..06ff03e69 100644 --- a/docs/types/handlers_router_helpers.AppRouteHandlerFnContext.html +++ b/docs/types/handlers_router_helpers.AppRouteHandlerFnContext.html @@ -1 +1 @@ -AppRouteHandlerFnContext | @auth0/nextjs-auth0
        \ No newline at end of file +AppRouteHandlerFnContext | @auth0/nextjs-auth0
        \ No newline at end of file diff --git a/docs/types/handlers_router_helpers.AppRouterHandler.html b/docs/types/handlers_router_helpers.AppRouterHandler.html index 24a490d7d..2313a19de 100644 --- a/docs/types/handlers_router_helpers.AppRouterHandler.html +++ b/docs/types/handlers_router_helpers.AppRouterHandler.html @@ -1,2 +1,2 @@ AppRouterHandler | @auth0/nextjs-auth0
        \ No newline at end of file +
        \ No newline at end of file diff --git a/docs/types/handlers_router_helpers.AuthHandler.html b/docs/types/handlers_router_helpers.AuthHandler.html index 58761d0df..d0e3b9f4e 100644 --- a/docs/types/handlers_router_helpers.AuthHandler.html +++ b/docs/types/handlers_router_helpers.AuthHandler.html @@ -1 +1 @@ -AuthHandler | @auth0/nextjs-auth0
        AuthHandler<Opts>: Handler<Opts> & {
            (provider?): Handler<Opts>;
            (options?): Handler<Opts>;
        }

        Type Parameters

        • Opts

        Type declaration

        \ No newline at end of file +AuthHandler | @auth0/nextjs-auth0
        AuthHandler<Opts>: Handler<Opts> & {
            (provider?): Handler<Opts>;
            (options?): Handler<Opts>;
        }

        Type Parameters

        • Opts

        Type declaration

        \ No newline at end of file diff --git a/docs/types/handlers_router_helpers.Handler.html b/docs/types/handlers_router_helpers.Handler.html index a17c8fbbc..202836924 100644 --- a/docs/types/handlers_router_helpers.Handler.html +++ b/docs/types/handlers_router_helpers.Handler.html @@ -1 +1 @@ -Handler | @auth0/nextjs-auth0
        Handler<Opts>: {
            (req, ctx, options?): Response | Promise<Response>;
            (req, res, options?): unknown;
            (req, resOrOpts, options?): unknown;
        }

        Type Parameters

        • Opts = any

        Type declaration

          • (req, ctx, options?): Response | Promise<Response>
          • Parameters

            Returns Response | Promise<Response>

          • (req, res, options?): unknown
          • Parameters

            • req: NextApiRequest
            • res: NextApiResponse<any>
            • Optional options: Opts

            Returns unknown

          • (req, resOrOpts, options?): unknown
          • Parameters

            Returns unknown

        \ No newline at end of file +Handler | @auth0/nextjs-auth0
        Handler<Opts>: {
            (req, ctx, options?): Response | Promise<Response>;
            (req, res, options?): unknown;
            (req, resOrOpts, options?): unknown;
        }

        Type Parameters

        • Opts = any

        Type declaration

          • (req, ctx, options?): Response | Promise<Response>
          • Parameters

            Returns Response | Promise<Response>

          • (req, res, options?): unknown
          • Parameters

            • req: NextApiRequest
            • res: NextApiResponse<any>
            • Optional options: Opts

            Returns unknown

          • (req, resOrOpts, options?): unknown
          • Parameters

            Returns unknown

        \ No newline at end of file diff --git a/docs/types/handlers_router_helpers.NextAppRouterHandler.html b/docs/types/handlers_router_helpers.NextAppRouterHandler.html index e4ec73be3..9a777b611 100644 --- a/docs/types/handlers_router_helpers.NextAppRouterHandler.html +++ b/docs/types/handlers_router_helpers.NextAppRouterHandler.html @@ -1 +1 @@ -NextAppRouterHandler | @auth0/nextjs-auth0
        \ No newline at end of file +NextAppRouterHandler | @auth0/nextjs-auth0
        \ No newline at end of file diff --git a/docs/types/handlers_router_helpers.NextPageRouterHandler.html b/docs/types/handlers_router_helpers.NextPageRouterHandler.html index 5a3fc4399..a8c616ce3 100644 --- a/docs/types/handlers_router_helpers.NextPageRouterHandler.html +++ b/docs/types/handlers_router_helpers.NextPageRouterHandler.html @@ -1 +1 @@ -NextPageRouterHandler | @auth0/nextjs-auth0
        \ No newline at end of file +NextPageRouterHandler | @auth0/nextjs-auth0
        \ No newline at end of file diff --git a/docs/types/handlers_router_helpers.OptionsProvider.html b/docs/types/handlers_router_helpers.OptionsProvider.html index 3f01f782b..778b330b6 100644 --- a/docs/types/handlers_router_helpers.OptionsProvider.html +++ b/docs/types/handlers_router_helpers.OptionsProvider.html @@ -1 +1 @@ -OptionsProvider | @auth0/nextjs-auth0
        \ No newline at end of file +OptionsProvider | @auth0/nextjs-auth0
        \ No newline at end of file diff --git a/docs/types/handlers_router_helpers.PageRouteHandlerFn.html b/docs/types/handlers_router_helpers.PageRouteHandlerFn.html index d9774cc6e..b64f6663b 100644 --- a/docs/types/handlers_router_helpers.PageRouteHandlerFn.html +++ b/docs/types/handlers_router_helpers.PageRouteHandlerFn.html @@ -1,2 +1,2 @@ PageRouteHandlerFn | @auth0/nextjs-auth0
        PageRouteHandlerFn<Options>: ((req, res, opts?) => Promise<void> | void)

        Type Parameters

        • Options

        Type declaration

          • (req, res, opts?): Promise<void> | void
          • Handler function for app routes.

            -

            Parameters

            • req: NextApiRequest
            • res: NextApiResponse
            • Optional opts: Options

            Returns Promise<void> | void

        \ No newline at end of file +

        Parameters

        • req: NextApiRequest
        • res: NextApiResponse
        • Optional opts: Options

        Returns Promise<void> | void

        \ No newline at end of file diff --git a/docs/types/handlers_router_helpers.PageRouterHandler.html b/docs/types/handlers_router_helpers.PageRouterHandler.html index c3400c97d..38199c3e6 100644 --- a/docs/types/handlers_router_helpers.PageRouterHandler.html +++ b/docs/types/handlers_router_helpers.PageRouterHandler.html @@ -1,2 +1,2 @@ PageRouterHandler | @auth0/nextjs-auth0
        \ No newline at end of file +
        \ No newline at end of file diff --git a/docs/types/helpers_testing.GenerateSessionCookieConfig.html b/docs/types/helpers_testing.GenerateSessionCookieConfig.html index b664c43d4..2c8746df0 100644 --- a/docs/types/helpers_testing.GenerateSessionCookieConfig.html +++ b/docs/types/helpers_testing.GenerateSessionCookieConfig.html @@ -4,4 +4,4 @@
      • secret: string

        The secret used to derive an encryption key for the session cookie.

        IMPORTANT: you must use the same value as in the SDK configuration. See ConfigParameters.secret.

        -
      • \ No newline at end of file +
        \ No newline at end of file diff --git a/docs/types/helpers_with_api_auth_required.AppRouteHandlerFn.html b/docs/types/helpers_with_api_auth_required.AppRouteHandlerFn.html index fd6b0d36c..14436c9fb 100644 --- a/docs/types/helpers_with_api_auth_required.AppRouteHandlerFn.html +++ b/docs/types/helpers_with_api_auth_required.AppRouteHandlerFn.html @@ -1,3 +1,3 @@ AppRouteHandlerFn | @auth0/nextjs-auth0
        \ No newline at end of file +

        Parameters

        Returns Promise<Response> | Response

        \ No newline at end of file diff --git a/docs/types/helpers_with_api_auth_required.AppRouteHandlerFnContext.html b/docs/types/helpers_with_api_auth_required.AppRouteHandlerFnContext.html index 35a2fa5d0..147f5684a 100644 --- a/docs/types/helpers_with_api_auth_required.AppRouteHandlerFnContext.html +++ b/docs/types/helpers_with_api_auth_required.AppRouteHandlerFnContext.html @@ -1,3 +1,3 @@ AppRouteHandlerFnContext | @auth0/nextjs-auth0
        \ No newline at end of file +

        Type declaration

        • Optional params?: Record<string, string | string[]>
        \ No newline at end of file diff --git a/docs/types/helpers_with_api_auth_required.WithApiAuthRequired.html b/docs/types/helpers_with_api_auth_required.WithApiAuthRequired.html index 69eae5338..9e2c2a453 100644 --- a/docs/types/helpers_with_api_auth_required.WithApiAuthRequired.html +++ b/docs/types/helpers_with_api_auth_required.WithApiAuthRequired.html @@ -1,3 +1,3 @@ WithApiAuthRequired | @auth0/nextjs-auth0
        \ No newline at end of file +
        \ No newline at end of file diff --git a/docs/types/helpers_with_api_auth_required.WithApiAuthRequiredAppRoute.html b/docs/types/helpers_with_api_auth_required.WithApiAuthRequiredAppRoute.html index 9a6cdbf43..796803d08 100644 --- a/docs/types/helpers_with_api_auth_required.WithApiAuthRequiredAppRoute.html +++ b/docs/types/helpers_with_api_auth_required.WithApiAuthRequiredAppRoute.html @@ -3,4 +3,4 @@
        // app/protected-api/route.js
        import { withApiAuthRequired, getSession } from '@auth0/nextjs-auth0';

        export default withApiAuthRequired(function Protected(req) {
        const session = getSession();
        ...
        });

        If you visit /protected-api without a valid session cookie, you will get a 401 response.

        -

        Parameters

        Returns AppRouteHandlerFn

        \ No newline at end of file +

        Parameters

        Returns AppRouteHandlerFn

        \ No newline at end of file diff --git a/docs/types/helpers_with_api_auth_required.WithApiAuthRequiredPageRoute.html b/docs/types/helpers_with_api_auth_required.WithApiAuthRequiredPageRoute.html index 931a1d2e6..7bbb9fd60 100644 --- a/docs/types/helpers_with_api_auth_required.WithApiAuthRequiredPageRoute.html +++ b/docs/types/helpers_with_api_auth_required.WithApiAuthRequiredPageRoute.html @@ -3,4 +3,4 @@
        // pages/api/protected-route.js
        import { withApiAuthRequired, getSession } from '@auth0/nextjs-auth0';

        export default withApiAuthRequired(function ProtectedRoute(req, res) {
        const session = getSession(req, res);
        ...
        });

        If you visit /api/protected-route without a valid session cookie, you will get a 401 response.

        -

        Parameters

        • apiRoute: NextApiHandler

        Returns NextApiHandler

        \ No newline at end of file +

        Parameters

        • apiRoute: NextApiHandler

        Returns NextApiHandler

        \ No newline at end of file diff --git a/docs/types/helpers_with_middleware_auth_required.WithMiddlewareAuthRequired.html b/docs/types/helpers_with_middleware_auth_required.WithMiddlewareAuthRequired.html index 2bb5fef36..c5aa477ca 100644 --- a/docs/types/helpers_with_middleware_auth_required.WithMiddlewareAuthRequired.html +++ b/docs/types/helpers_with_middleware_auth_required.WithMiddlewareAuthRequired.html @@ -15,4 +15,4 @@

        You can also provide a method for returnTo that takes the req as an argument.

        // middleware.js
        import { withMiddlewareAuthRequired, getSession } from '@auth0/nextjs-auth0/edge';

        export default withMiddlewareAuthRequired({
        returnTo(req) { return `${req.nextURL.basePath}${req.nextURL.pathname}`};
        });
        -

        Parameters

        Returns NextMiddleware

        \ No newline at end of file +

        Parameters

        Returns NextMiddleware

        \ No newline at end of file diff --git a/docs/types/helpers_with_middleware_auth_required.WithMiddlewareAuthRequiredOptions.html b/docs/types/helpers_with_middleware_auth_required.WithMiddlewareAuthRequiredOptions.html index bc2bb7934..e30974729 100644 --- a/docs/types/helpers_with_middleware_auth_required.WithMiddlewareAuthRequiredOptions.html +++ b/docs/types/helpers_with_middleware_auth_required.WithMiddlewareAuthRequiredOptions.html @@ -1,2 +1,2 @@ WithMiddlewareAuthRequiredOptions | @auth0/nextjs-auth0
        WithMiddlewareAuthRequiredOptions: {
            middleware?: NextMiddleware;
            returnTo?: string | ((req) => Promise<string> | string);
        }

        Pass custom options to WithMiddlewareAuthRequired.

        -

        Type declaration

        • Optional middleware?: NextMiddleware
        • Optional returnTo?: string | ((req) => Promise<string> | string)
        \ No newline at end of file +

        Type declaration

        • Optional middleware?: NextMiddleware
        • Optional returnTo?: string | ((req) => Promise<string> | string)
        \ No newline at end of file diff --git a/docs/types/helpers_with_page_auth_required.AppRouterPageRoute.html b/docs/types/helpers_with_page_auth_required.AppRouterPageRoute.html index f57b61650..14fd910be 100644 --- a/docs/types/helpers_with_page_auth_required.AppRouterPageRoute.html +++ b/docs/types/helpers_with_page_auth_required.AppRouterPageRoute.html @@ -1,2 +1,2 @@ AppRouterPageRoute | @auth0/nextjs-auth0
        \ No newline at end of file +

        Parameters

        Returns Promise<React.JSX.Element>

        \ No newline at end of file diff --git a/docs/types/helpers_with_page_auth_required.AppRouterPageRouteOpts.html b/docs/types/helpers_with_page_auth_required.AppRouterPageRouteOpts.html index fed817f71..b1f95bfa8 100644 --- a/docs/types/helpers_with_page_auth_required.AppRouterPageRouteOpts.html +++ b/docs/types/helpers_with_page_auth_required.AppRouterPageRouteOpts.html @@ -1,2 +1,2 @@ AppRouterPageRouteOpts | @auth0/nextjs-auth0
        AppRouterPageRouteOpts: {
            params?: Record<string, string | string[]>;
            searchParams?: {
                [key: string]: string | string[] | undefined;
            };
        }

        Objects containing the route parameters and search parameters of th page.

        -

        Type declaration

        • Optional params?: Record<string, string | string[]>
        • Optional searchParams?: {
              [key: string]: string | string[] | undefined;
          }
          • [key: string]: string | string[] | undefined
        \ No newline at end of file +

        Type declaration

        • Optional params?: Record<string, string | string[]>
        • Optional searchParams?: {
              [key: string]: string | string[] | undefined;
          }
          • [key: string]: string | string[] | undefined
        \ No newline at end of file diff --git a/docs/types/helpers_with_page_auth_required.GetServerSidePropsResultWithSession.html b/docs/types/helpers_with_page_auth_required.GetServerSidePropsResultWithSession.html index fa2a0076b..acdd49196 100644 --- a/docs/types/helpers_with_page_auth_required.GetServerSidePropsResultWithSession.html +++ b/docs/types/helpers_with_page_auth_required.GetServerSidePropsResultWithSession.html @@ -2,4 +2,4 @@ the user property, which will be the user's Claims.

        // pages/profile.js
        import { withPageAuthRequired } from '@auth0/nextjs-auth0';

        export default function Profile({ user }) {
        return <div>Hello {user.name}</div>;
        }

        export const getServerSideProps = withPageAuthRequired();
        -

        Type Parameters

        • P = any

        \ No newline at end of file +

        Type Parameters

        • P = any

        \ No newline at end of file diff --git a/docs/types/helpers_with_page_auth_required.PageRoute.html b/docs/types/helpers_with_page_auth_required.PageRoute.html index 9b8c7b433..adab73373 100644 --- a/docs/types/helpers_with_page_auth_required.PageRoute.html +++ b/docs/types/helpers_with_page_auth_required.PageRoute.html @@ -1,2 +1,2 @@ PageRoute | @auth0/nextjs-auth0
        \ No newline at end of file +

        Parameters

        • ctx: GetServerSidePropsContext<Q>

        Returns Promise<GetServerSidePropsResultWithSession<P>>

        \ No newline at end of file diff --git a/docs/types/helpers_with_page_auth_required.WithPageAuthRequired.html b/docs/types/helpers_with_page_auth_required.WithPageAuthRequired.html index 1e4c9f4e2..6cd0aba5d 100644 --- a/docs/types/helpers_with_page_auth_required.WithPageAuthRequired.html +++ b/docs/types/helpers_with_page_auth_required.WithPageAuthRequired.html @@ -1,3 +1,3 @@ WithPageAuthRequired | @auth0/nextjs-auth0
        \ No newline at end of file +
        \ No newline at end of file diff --git a/docs/types/helpers_with_page_auth_required.WithPageAuthRequiredAppRouter.html b/docs/types/helpers_with_page_auth_required.WithPageAuthRequiredAppRouter.html index c6e405beb..a2571ee72 100644 --- a/docs/types/helpers_with_page_auth_required.WithPageAuthRequiredAppRouter.html +++ b/docs/types/helpers_with_page_auth_required.WithPageAuthRequiredAppRouter.html @@ -11,4 +11,4 @@ argument from the page, to preserve dynamic routes and search params.

        // app/protected-page/[slug]/page.js
        import { withPageAuthRequired } from '@auth0/nextjs-auth0';

        export default function withPageAuthRequired(ProtectedPage() {
        return <div>Protected content</div>;
        }, {
        returnTo({ params }) {
        return `/protected-page/${params.slug}`
        }
        });
        -

        Returns AppRouterPageRoute

        \ No newline at end of file +

        Returns AppRouterPageRoute

        \ No newline at end of file diff --git a/docs/types/helpers_with_page_auth_required.WithPageAuthRequiredAppRouterOptions.html b/docs/types/helpers_with_page_auth_required.WithPageAuthRequiredAppRouterOptions.html index bd7711497..9956a5207 100644 --- a/docs/types/helpers_with_page_auth_required.WithPageAuthRequiredAppRouterOptions.html +++ b/docs/types/helpers_with_page_auth_required.WithPageAuthRequiredAppRouterOptions.html @@ -1,3 +1,3 @@ WithPageAuthRequiredAppRouterOptions | @auth0/nextjs-auth0
        WithPageAuthRequiredAppRouterOptions: {
            returnTo?: string | ((obj) => Promise<string> | string);
        }

        Specify the URL to returnTo - this is important in app router pages because the server component won't know the URL of the page.

        -

        Type declaration

        • Optional returnTo?: string | ((obj) => Promise<string> | string)
        \ No newline at end of file +

        Type declaration

        • Optional returnTo?: string | ((obj) => Promise<string> | string)
        \ No newline at end of file diff --git a/docs/types/helpers_with_page_auth_required.WithPageAuthRequiredPageRouter.html b/docs/types/helpers_with_page_auth_required.WithPageAuthRequiredPageRouter.html index 70d921e53..77dfd0f54 100644 --- a/docs/types/helpers_with_page_auth_required.WithPageAuthRequiredPageRouter.html +++ b/docs/types/helpers_with_page_auth_required.WithPageAuthRequiredPageRouter.html @@ -4,4 +4,4 @@

        If the user visits /protected-page without a valid session, it will redirect the user to the login page. Then they will be returned to /protected-page after login.

        -

        Type Parameters

        • P extends {
              [key: string]: any;
          } = {
              [key: string]: any;
          }

        • Q extends ParsedUrlQuery = ParsedUrlQuery

        Parameters

        Returns PageRoute<P, Q>

        \ No newline at end of file +

        Type Parameters

        • P extends {
              [key: string]: any;
          } = {
              [key: string]: any;
          }

        • Q extends ParsedUrlQuery = ParsedUrlQuery

        Parameters

        Returns PageRoute<P, Q>

        \ No newline at end of file diff --git a/docs/types/helpers_with_page_auth_required.WithPageAuthRequiredPageRouterOptions.html b/docs/types/helpers_with_page_auth_required.WithPageAuthRequiredPageRouterOptions.html index 18dd44f4d..ccc82a243 100644 --- a/docs/types/helpers_with_page_auth_required.WithPageAuthRequiredPageRouterOptions.html +++ b/docs/types/helpers_with_page_auth_required.WithPageAuthRequiredPageRouterOptions.html @@ -4,4 +4,4 @@ inside of this method. For example:

        // pages/protected-page.js
        import { getSession, withPageAuthRequired } from '@auth0/nextjs-auth0';

        export default function ProtectedPage({ user, customProp }) {
        return <div>Protected content</div>;
        }

        export const getServerSideProps = withPageAuthRequired({
        // returnTo: '/unauthorized',
        async getServerSideProps(ctx) {
        // access the user session if needed
        // const session = await getSession(ctx.req, ctx.res);
        return {
        props: {
        // customProp: 'bar',
        }
        };
        }
        });
        -

        Type Parameters

        • P extends {
              [key: string]: any;
          } = {
              [key: string]: any;
          }

        • Q extends ParsedUrlQuery = ParsedUrlQuery

        Type declaration

        • Optional getServerSideProps?: GetServerSideProps<P, Q>
        • Optional returnTo?: string
        \ No newline at end of file +

        Type Parameters

        • P extends {
              [key: string]: any;
          } = {
              [key: string]: any;
          }

        • Q extends ParsedUrlQuery = ParsedUrlQuery

        Type declaration

        • Optional getServerSideProps?: GetServerSideProps<P, Q>
        • Optional returnTo?: string
        \ No newline at end of file diff --git a/docs/types/index.Auth0Server.html b/docs/types/index.Auth0Server.html index 58fe29b36..885500309 100644 --- a/docs/types/index.Auth0Server.html +++ b/docs/types/index.Auth0Server.html @@ -1 +1 @@ -Auth0Server | @auth0/nextjs-auth0
        \ No newline at end of file +Auth0Server | @auth0/nextjs-auth0
        \ No newline at end of file diff --git a/docs/types/index.InitAuth0.html b/docs/types/index.InitAuth0.html index 7fe019ae5..a42295888 100644 --- a/docs/types/index.InitAuth0.html +++ b/docs/types/index.InitAuth0.html @@ -1,3 +1,3 @@ InitAuth0 | @auth0/nextjs-auth0
        InitAuth0: ((params?) => Omit<Auth0Server, "withMiddlewareAuthRequired">)

        Type declaration

        \ No newline at end of file +

        Parameters

        Returns Omit<Auth0Server, "withMiddlewareAuthRequired">

        \ No newline at end of file diff --git a/docs/types/init.InitAuth0.html b/docs/types/init.InitAuth0.html index 45dc1f101..dbd0e0adf 100644 --- a/docs/types/init.InitAuth0.html +++ b/docs/types/init.InitAuth0.html @@ -1,3 +1,3 @@ InitAuth0 | @auth0/nextjs-auth0
        \ No newline at end of file +

        Parameters

        Returns Auth0Server

        \ No newline at end of file diff --git a/docs/types/session_get_access_token.AfterRefresh.html b/docs/types/session_get_access_token.AfterRefresh.html index 44069e438..cb1bb1a3f 100644 --- a/docs/types/session_get_access_token.AfterRefresh.html +++ b/docs/types/session_get_access_token.AfterRefresh.html @@ -1,2 +1,2 @@ AfterRefresh | @auth0/nextjs-auth0
        \ No newline at end of file +
        \ No newline at end of file diff --git a/docs/types/session_get_access_token.AfterRefreshAppRoute.html b/docs/types/session_get_access_token.AfterRefreshAppRoute.html index 1c84e6143..de28a7d0b 100644 --- a/docs/types/session_get_access_token.AfterRefreshAppRoute.html +++ b/docs/types/session_get_access_token.AfterRefreshAppRoute.html @@ -1,2 +1,2 @@ AfterRefreshAppRoute | @auth0/nextjs-auth0
        \ No newline at end of file +

        Parameters

        Returns Promise<default> | default

        \ No newline at end of file diff --git a/docs/types/session_get_access_token.AfterRefreshPageRoute.html b/docs/types/session_get_access_token.AfterRefreshPageRoute.html index f1ffbd19c..5c844113d 100644 --- a/docs/types/session_get_access_token.AfterRefreshPageRoute.html +++ b/docs/types/session_get_access_token.AfterRefreshPageRoute.html @@ -1,2 +1,2 @@ AfterRefreshPageRoute | @auth0/nextjs-auth0
        AfterRefreshPageRoute: ((req, res, session) => Promise<default> | default)

        Type declaration

          • (req, res, session): Promise<default> | default
          • After refresh handler for page router.

            -

            Parameters

            • req: NextApiRequest | IncomingMessage
            • res: NextApiResponse | ServerResponse
            • session: default

            Returns Promise<default> | default

        \ No newline at end of file +

        Parameters

        • req: NextApiRequest | IncomingMessage
        • res: NextApiResponse | ServerResponse
        • session: default

        Returns Promise<default> | default

        \ No newline at end of file diff --git a/docs/types/session_get_access_token.GetAccessToken.html b/docs/types/session_get_access_token.GetAccessToken.html index 2fad87c1f..f4944747a 100644 --- a/docs/types/session_get_access_token.GetAccessToken.html +++ b/docs/types/session_get_access_token.GetAccessToken.html @@ -23,4 +23,4 @@
        import { NextResponse } from 'next/server';
        import { getAccessToken } from '@auth0/nextjs-auth0/edge'; // Note the /edge import


        export async function middleware(req) {
        const res = new NextResponse();
        const { accessToken } = await getAccessToken(req, res);
        return NextResponse.redirect(new URL('/bar', request.url), res);
        }

        export const config = {
        matcher: '/foo',
        };

        Parameters

        Returns Promise<GetAccessTokenResult>

        \ No newline at end of file +
        \ No newline at end of file diff --git a/docs/types/session_get_session.GetSession.html b/docs/types/session_get_session.GetSession.html index 5ba1028c5..fd545b35b 100644 --- a/docs/types/session_get_session.GetSession.html +++ b/docs/types/session_get_session.GetSession.html @@ -23,4 +23,4 @@

        In middleware:

        import { NextResponse } from 'next/server';
        import { getSession } from '@auth0/nextjs-auth0/edge'; // Note the /edge import

        export async function middleware(req) {
        const res = new NextResponse();
        const { user } = await getSession(req, res);
        return NextResponse.redirect(new URL('/bar', request.url), res);
        }

        export const config = {
        matcher: '/foo',
        };

        @category Server
        -

        Parameters

        • Rest ...args: [IncomingMessage, ServerResponse] | [NextApiRequest, NextApiResponse] | [NextRequest, NextResponse] | []

        Returns Promise<default | null | undefined>

        \ No newline at end of file +

        Parameters

        • Rest ...args: [IncomingMessage, ServerResponse] | [NextApiRequest, NextApiResponse] | [NextRequest, NextResponse] | []

        Returns Promise<default | null | undefined>

        \ No newline at end of file diff --git a/docs/types/session_touch_session.TouchSession.html b/docs/types/session_touch_session.TouchSession.html index b9de9c254..5f6ac89e6 100644 --- a/docs/types/session_touch_session.TouchSession.html +++ b/docs/types/session_touch_session.TouchSession.html @@ -24,4 +24,4 @@

        In middleware:

        import { NextResponse } from 'next/server';
        import { touchSession } from '@auth0/nextjs-auth0/edge'; // Note the /edge import

        export async function middleware(req) {
        const res = new NextResponse();
        await touchSession(req, res);
        return NextResponse.redirect(new URL('/bar', request.url), res);
        }

        export const config = {
        matcher: '/foo',
        };

        @category Server
        -

        Parameters

        • Rest ...args: [IncomingMessage, ServerResponse] | [NextApiRequest, NextApiResponse] | [NextRequest, NextResponse] | []

        Returns Promise<void>

        \ No newline at end of file +

        Parameters

        • Rest ...args: [IncomingMessage, ServerResponse] | [NextApiRequest, NextApiResponse] | [NextRequest, NextResponse] | []

        Returns Promise<void>

        \ No newline at end of file diff --git a/docs/types/session_update_session.UpdateSession.html b/docs/types/session_update_session.UpdateSession.html index 8184457af..9da3bd1d5 100644 --- a/docs/types/session_update_session.UpdateSession.html +++ b/docs/types/session_update_session.UpdateSession.html @@ -25,4 +25,4 @@

        In middleware:

        import { NextResponse } from 'next/server';
        import { getSession, updateSession } from '@auth0/nextjs-auth0/edge'; // Note the /edge import

        export async function middleware(req) {
        const res = new NextResponse();
        const { user } = await getSession(req, res);
        await updateSession(req, res, { ...session, user: { ...session.user, foo: 'bar' }});
        return NextResponse.redirect(new URL('/bar', request.url), res);
        }

        // See "Matching Paths" below to learn more
        export const config = {
        matcher: '/foo',
        };

        @category Server
        -

        Parameters

        • Rest ...args: [IncomingMessage, ServerResponse, default] | [NextApiRequest, NextApiResponse, default] | [NextRequest, NextResponse, default] | [default]

        Returns Promise<void>

        \ No newline at end of file +

        Parameters

        • Rest ...args: [IncomingMessage, ServerResponse, default] | [NextApiRequest, NextApiResponse, default] | [NextRequest, NextResponse, default] | [default]

        Returns Promise<void>

        \ No newline at end of file diff --git a/docs/types/shared.SessionStore.html b/docs/types/shared.SessionStore.html index 18b506e93..0aa752760 100644 --- a/docs/types/shared.SessionStore.html +++ b/docs/types/shared.SessionStore.html @@ -1 +1 @@ -SessionStore | @auth0/nextjs-auth0
        \ No newline at end of file +SessionStore | @auth0/nextjs-auth0
        \ No newline at end of file diff --git a/docs/types/shared.SessionStorePayload.html b/docs/types/shared.SessionStorePayload.html index 01c82c696..06b9f1566 100644 --- a/docs/types/shared.SessionStorePayload.html +++ b/docs/types/shared.SessionStorePayload.html @@ -1 +1 @@ -SessionStorePayload | @auth0/nextjs-auth0
        \ No newline at end of file +SessionStorePayload | @auth0/nextjs-auth0
        \ No newline at end of file diff --git a/docs/variables/shared.telemetry.html b/docs/variables/shared.telemetry.html index a62ec2c8f..6dd89d128 100644 --- a/docs/variables/shared.telemetry.html +++ b/docs/variables/shared.telemetry.html @@ -1 +1 @@ -telemetry | @auth0/nextjs-auth0
        \ No newline at end of file +telemetry | @auth0/nextjs-auth0
        \ No newline at end of file diff --git a/docs/variables/version.default.html b/docs/variables/version.default.html index 5d41c0615..957ec3529 100644 --- a/docs/variables/version.default.html +++ b/docs/variables/version.default.html @@ -1 +1 @@ -default | @auth0/nextjs-auth0
        \ No newline at end of file +default | @auth0/nextjs-auth0
        \ No newline at end of file From 63ea1bf41e0c66a8982abc4502034bb309f10387 Mon Sep 17 00:00:00 2001 From: Tushar Pandey Date: Fri, 31 Jan 2025 16:26:47 +0530 Subject: [PATCH 11/23] skip coverage for V3 --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 3fb2d2c73..82e74b9d5 100644 --- a/package.json +++ b/package.json @@ -39,8 +39,8 @@ "build:vercel": "npm run install:example && npm run build && npm run build:example", "start:example": "npm run dev --prefix=example-app", "start:example-local": "npm run dev:local --prefix=example-app", - "test": "jest tests --coverage", - "test:watch": "jest --coverage --watch", + "test": "jest tests", + "test:watch": "jest", "test:example": "start-server-and-test start:example http-get://localhost:3000 cypress:run", "test:example:watch": "start-server-and-test start:example 3000 cypress:open", "test:example-local": "npx start-server-and-test 'start:example-local' http://localhost:3000 'cypress run --config-file=./cypress-local.config.js'", From e9e15171773a7bd1a8b748571cf842b60d9f82ee Mon Sep 17 00:00:00 2001 From: Frederik Prijck Date: Sun, 23 Mar 2025 09:44:00 +0100 Subject: [PATCH 12/23] Enforce nextjs peerDependency to 13.5.9, 14.2.25 and 15.2.3 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 82e74b9d5..bf123cf51 100644 --- a/package.json +++ b/package.json @@ -131,7 +131,7 @@ "url-join": "^4.0.1" }, "peerDependencies": { - "next": ">=10" + "next": "^10.0.0 || ^11.0.0 || ^12.0.0 || ^13.5.9 || ^14.2.25 || ^15.2.3" }, "jest": { "collectCoverageFrom": [ From ca47208326e1848433dc501f4e0b43ca9b77fdf0 Mon Sep 17 00:00:00 2001 From: Frederik Prijck Date: Sun, 23 Mar 2025 11:52:25 +0100 Subject: [PATCH 13/23] Include v12.3.2 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index bf123cf51..72b194dd7 100644 --- a/package.json +++ b/package.json @@ -131,7 +131,7 @@ "url-join": "^4.0.1" }, "peerDependencies": { - "next": "^10.0.0 || ^11.0.0 || ^12.0.0 || ^13.5.9 || ^14.2.25 || ^15.2.3" + "next": "^10.0.0 || ^11.0.0 || ^12.3.2 || ^13.5.9 || ^14.2.25 || ^15.2.3" }, "jest": { "collectCoverageFrom": [ From 0c18407b5cba352c868a6158cd223da1570c09ff Mon Sep 17 00:00:00 2001 From: Frederik Prijck Date: Sun, 23 Mar 2025 22:33:53 +0100 Subject: [PATCH 14/23] Update peerDependency for v12 to v12.3.5 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 72b194dd7..db84b060f 100644 --- a/package.json +++ b/package.json @@ -131,7 +131,7 @@ "url-join": "^4.0.1" }, "peerDependencies": { - "next": "^10.0.0 || ^11.0.0 || ^12.3.2 || ^13.5.9 || ^14.2.25 || ^15.2.3" + "next": "^10.0.0 || ^11.0.0 || ^12.3.5 || ^13.5.9 || ^14.2.25 || ^15.2.3" }, "jest": { "collectCoverageFrom": [ From a778a8a2f58400dc184e14f021cfd1cfbacd0ee7 Mon Sep 17 00:00:00 2001 From: Frederik Prijck Date: Fri, 9 May 2025 13:42:14 +0200 Subject: [PATCH 15/23] Update JSDocs to mention idpLogout defaults to true --- src/auth0-session/config.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/auth0-session/config.ts b/src/auth0-session/config.ts index 708be8824..4a0991358 100644 --- a/src/auth0-session/config.ts +++ b/src/auth0-session/config.ts @@ -139,7 +139,7 @@ export interface Config { identityClaimFilter: string[]; /** - * Boolean value to log the user out from the identity provider on application logout. Defaults to `false`. + * Boolean value to log the user out from the identity provider on application logout. Defaults to `true`. */ idpLogout: boolean; From c7563480f015d29e71bb487a9218eee356d82472 Mon Sep 17 00:00:00 2001 From: Frederik Prijck Date: Mon, 24 Mar 2025 08:56:27 +0100 Subject: [PATCH 16/23] Release v3.7.0 --- .version | 2 +- CHANGELOG.md | 11 ++++++++++- package.json | 2 +- src/version.ts | 2 +- 4 files changed, 13 insertions(+), 4 deletions(-) diff --git a/.version b/.version index 130165bc0..d1e9cf3bb 100644 --- a/.version +++ b/.version @@ -1 +1 @@ -v3.6.0 +v3.7.0 diff --git a/CHANGELOG.md b/CHANGELOG.md index f03d752ee..438be2e66 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,11 +1,20 @@ # Change Log +## [v3.7.0](https://github.com/auth0/nextjs-auth0/tree/v3.7.0) (2025-03-24) +[Full Changelog](https://github.com/auth0/nextjs-auth0/compare/v3.6.0...v3.7.0) + +**Security** +- Enforce nextjs peerDependency to 12.3.5, 13.5.9, 14.2.25 and 15.2.3 [\#1989](https://github.com/auth0/nextjs-auth0/pull/1989) ([frederikprijck](https://github.com/frederikprijck)) + +The above security fix was done to help prevent customers being vulnerable to [Authorization Bypass in Next.js Middleware](https://github.com/advisories/GHSA-f82v-jwr5-mffw). + ## [v3.6.0](https://github.com/auth0/nextjs-auth0/tree/v3.6.0) (2025-01-31) +[Full Changelog](https://github.com/auth0/nextjs-auth0/compare/v3.5.0...v3.6.0) + This is a maintainance release for V3 of the SDK. V4 supports Next.JS 15 and React 19 and is published on [npm](https://www.npmjs.com/package/@auth0/nextjs-auth0)! We will continue to add features and security upgrades in V4 going further. Please migrate to V4 for a better experience. - **Security** - [bump jshttp/cookie from 0.6.0 to 0.7.1](https://github.com/auth0/nextjs-auth0/pull/1778) diff --git a/package.json b/package.json index db84b060f..9e233e6bf 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@auth0/nextjs-auth0", - "version": "3.6.0", + "version": "3.7.0", "description": "Next.js SDK for signing in with Auth0", "exports": { ".": "./dist/index.js", diff --git a/src/version.ts b/src/version.ts index 5047ed2cd..e1d36212a 100644 --- a/src/version.ts +++ b/src/version.ts @@ -1 +1 @@ -export default '3.6.0'; +export default '3.7.0'; From e1f9abe118e9657de1a6bb7f8d5e3604ac9b848e Mon Sep 17 00:00:00 2001 From: Frederik Prijck Date: Mon, 24 Mar 2025 09:31:12 +0100 Subject: [PATCH 17/23] Update Release workflow to use v3 tag --- .github/actions/npm-publish/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/npm-publish/action.yml b/.github/actions/npm-publish/action.yml index 57679d5c3..d63762e34 100644 --- a/.github/actions/npm-publish/action.yml +++ b/.github/actions/npm-publish/action.yml @@ -44,7 +44,7 @@ runs: elif [[ "${VERSION}" == *"alpha"* ]]; then TAG="alpha" else - TAG="latest" + TAG="v3" fi npm publish --provenance --tag $TAG env: From 965cc702272e26eebb722e4832a043f8581a5da2 Mon Sep 17 00:00:00 2001 From: arpit-jain_atko Date: Fri, 16 May 2025 16:19:38 +0530 Subject: [PATCH 18/23] Add storeIDToken to config params docs --- src/config.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/config.ts b/src/config.ts index cd5a2d75d..b979b4206 100644 --- a/src/config.ts +++ b/src/config.ts @@ -70,6 +70,7 @@ export interface NextConfig extends BaseConfig { * - `AUTH0_SESSION_ROLLING_DURATION`: See {@link SessionConfig.rollingDuration}. * - `AUTH0_SESSION_ABSOLUTE_DURATION`: See {@link SessionConfig.absoluteDuration}. * - `AUTH0_SESSION_AUTO_SAVE`: See {@link SessionConfig.autoSave}. + * - `AUTH0_SESSION_STORE_ID_TOKEN`: See {@link SessionConfig.storeIDToken}. * - `AUTH0_COOKIE_DOMAIN`: See {@link CookieConfig.domain}. * - `AUTH0_COOKIE_PATH`: See {@link CookieConfig.path}. * - `AUTH0_COOKIE_TRANSIENT`: See {@link CookieConfig.transient}. From 87a92c70b016896cfb50b98d8a58dfecf4ff277e Mon Sep 17 00:00:00 2001 From: Frederik Prijck Date: Mon, 12 May 2025 12:37:38 +0200 Subject: [PATCH 19/23] Update useUser example to use a tag instead of Link --- src/client/use-user.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/client/use-user.tsx b/src/client/use-user.tsx index 4940b435e..94ca32440 100644 --- a/src/client/use-user.tsx +++ b/src/client/use-user.tsx @@ -162,7 +162,7 @@ export type UseUser = () => UserContext; * * ```js * // pages/profile.js - * import Link from 'next/link'; + * 'use client'; * import { useUser } from '@auth0/nextjs-auth0/client'; * * export default function Profile() { @@ -170,8 +170,8 @@ export type UseUser = () => UserContext; * * if (isLoading) return
        Loading...
        ; * if (error) return
        {error.message}
        ; - * if (!user) return Login; - * return
        Hello {user.name}, Logout
        ; + * if (!user) return Login; + * return
        Hello {user.name}, Logout
        ; * } * ``` * From f0292ecf9b76b2af6720d1871cd665b56528d5ca Mon Sep 17 00:00:00 2001 From: Arpit Jain <167312832+arpit-jn@users.noreply.github.com> Date: Fri, 16 May 2025 18:10:43 +0530 Subject: [PATCH 20/23] Upgrade jose and openid-client to fix security vulnerabilities (#2104) Co-authored-by: Frederik Prijck --- package-lock.json | 40 +++++++++++++++++++++------------------- package.json | 4 ++-- 2 files changed, 23 insertions(+), 21 deletions(-) diff --git a/package-lock.json b/package-lock.json index 91b4d5fc9..b92567071 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,21 +1,21 @@ { "name": "@auth0/nextjs-auth0", - "version": "3.5.0", + "version": "3.7.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@auth0/nextjs-auth0", - "version": "3.5.0", + "version": "3.7.0", "license": "MIT", "dependencies": { "@panva/hkdf": "^1.0.2", "cookie": "^0.7.1", "debug": "^4.3.4", "joi": "^17.6.0", - "jose": "^4.9.2", + "jose": "^4.15.5", "oauth4webapi": "^2.3.0", - "openid-client": "^5.2.1", + "openid-client": "^5.6.5", "tslib": "^2.4.0", "url-join": "^4.0.1" }, @@ -76,7 +76,7 @@ "node": ">=16" }, "peerDependencies": { - "next": ">=10" + "next": "^10.0.0 || ^11.0.0 || ^12.3.5 || ^13.5.9 || ^14.2.25 || ^15.2.3" } }, "node_modules/@adobe/css-tools": { @@ -10282,9 +10282,10 @@ } }, "node_modules/jose": { - "version": "4.15.4", - "resolved": "https://registry.npmjs.org/jose/-/jose-4.15.4.tgz", - "integrity": "sha512-W+oqK4H+r5sITxfxpSU+MMdr/YSWGvgZMQDIsNoBDGGy4i7GBPTtvFKibQzW06n3U3TqHjhvBJsirShsEJ6eeQ==", + "version": "4.15.9", + "resolved": "https://a0us.jfrog.io/artifactory/api/npm/npm/jose/-/jose-4.15.9.tgz", + "integrity": "sha512-1vUQX+IdDMVPj4k8kOxgUqlcK518yluMuGZwqlr44FS1ppZB/5GWh4rZG89erpOBOJjU/OBsnCVFfapsRz6nEA==", + "license": "MIT", "funding": { "url": "https://github.com/sponsors/panva" } @@ -11708,11 +11709,12 @@ "dev": true }, "node_modules/openid-client": { - "version": "5.6.1", - "resolved": "https://registry.npmjs.org/openid-client/-/openid-client-5.6.1.tgz", - "integrity": "sha512-PtrWsY+dXg6y8mtMPyL/namZSYVz8pjXz3yJiBNZsEdCnu9miHLB4ELVC85WvneMKo2Rg62Ay7NkuCpM0bgiLQ==", + "version": "5.7.1", + "resolved": "https://a0us.jfrog.io/artifactory/api/npm/npm/openid-client/-/openid-client-5.7.1.tgz", + "integrity": "sha512-jDBPgSVfTnkIh71Hg9pRvtJc6wTwqjRkN88+gCFtYWrlP4Yx2Dsrow8uPi3qLr/aeymPF3o2+dS+wOpglK04ew==", + "license": "MIT", "dependencies": { - "jose": "^4.15.1", + "jose": "^4.15.9", "lru-cache": "^6.0.0", "object-hash": "^2.2.0", "oidc-token-hash": "^5.0.3" @@ -23025,9 +23027,9 @@ } }, "jose": { - "version": "4.15.4", - "resolved": "https://registry.npmjs.org/jose/-/jose-4.15.4.tgz", - "integrity": "sha512-W+oqK4H+r5sITxfxpSU+MMdr/YSWGvgZMQDIsNoBDGGy4i7GBPTtvFKibQzW06n3U3TqHjhvBJsirShsEJ6eeQ==" + "version": "4.15.9", + "resolved": "https://a0us.jfrog.io/artifactory/api/npm/npm/jose/-/jose-4.15.9.tgz", + "integrity": "sha512-1vUQX+IdDMVPj4k8kOxgUqlcK518yluMuGZwqlr44FS1ppZB/5GWh4rZG89erpOBOJjU/OBsnCVFfapsRz6nEA==" }, "js-message": { "version": "1.0.5", @@ -24106,11 +24108,11 @@ "dev": true }, "openid-client": { - "version": "5.6.1", - "resolved": "https://registry.npmjs.org/openid-client/-/openid-client-5.6.1.tgz", - "integrity": "sha512-PtrWsY+dXg6y8mtMPyL/namZSYVz8pjXz3yJiBNZsEdCnu9miHLB4ELVC85WvneMKo2Rg62Ay7NkuCpM0bgiLQ==", + "version": "5.7.1", + "resolved": "https://a0us.jfrog.io/artifactory/api/npm/npm/openid-client/-/openid-client-5.7.1.tgz", + "integrity": "sha512-jDBPgSVfTnkIh71Hg9pRvtJc6wTwqjRkN88+gCFtYWrlP4Yx2Dsrow8uPi3qLr/aeymPF3o2+dS+wOpglK04ew==", "requires": { - "jose": "^4.15.1", + "jose": "^4.15.9", "lru-cache": "^6.0.0", "object-hash": "^2.2.0", "oidc-token-hash": "^5.0.3" diff --git a/package.json b/package.json index 9e233e6bf..7688ada89 100644 --- a/package.json +++ b/package.json @@ -124,9 +124,9 @@ "cookie": "^0.7.1", "debug": "^4.3.4", "joi": "^17.6.0", - "jose": "^4.9.2", + "jose": "^4.15.5", "oauth4webapi": "^2.3.0", - "openid-client": "^5.2.1", + "openid-client": "^5.6.5", "tslib": "^2.4.0", "url-join": "^4.0.1" }, From bc08a133a0b0fe5a7205108e835fa378b59193da Mon Sep 17 00:00:00 2001 From: Frederik Prijck Date: Wed, 21 May 2025 10:18:46 +0200 Subject: [PATCH 21/23] refactor: use a single client assertion audience (#2024) Co-authored-by: Filip Skokan Co-authored-by: Tushar Pandey Co-authored-by: Tushar Pandey --- package-lock.json | 25 +++++++------- package.json | 4 +-- src/auth0-session/client/edge-client.ts | 46 +++++++++++++++++++++++-- 3 files changed, 59 insertions(+), 16 deletions(-) diff --git a/package-lock.json b/package-lock.json index b92567071..d6e187217 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14,8 +14,8 @@ "debug": "^4.3.4", "joi": "^17.6.0", "jose": "^4.15.5", - "oauth4webapi": "^2.3.0", - "openid-client": "^5.6.5", + "oauth4webapi": "^2.17.0", + "openid-client": "^5.7.1", "tslib": "^2.4.0", "url-join": "^4.0.1" }, @@ -10283,7 +10283,7 @@ }, "node_modules/jose": { "version": "4.15.9", - "resolved": "https://a0us.jfrog.io/artifactory/api/npm/npm/jose/-/jose-4.15.9.tgz", + "resolved": "https://registry.npmjs.org/jose/-/jose-4.15.9.tgz", "integrity": "sha512-1vUQX+IdDMVPj4k8kOxgUqlcK518yluMuGZwqlr44FS1ppZB/5GWh4rZG89erpOBOJjU/OBsnCVFfapsRz6nEA==", "license": "MIT", "funding": { @@ -11463,9 +11463,10 @@ } }, "node_modules/oauth4webapi": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/oauth4webapi/-/oauth4webapi-2.4.0.tgz", - "integrity": "sha512-ZWl8ov8HeGVyc9Icl1cag76HvIcDAp23eIIT+UVGir+dEu8BMgMlvZeZwqLVd0P8DqaumH4N+QLQXN69G1QjSA==", + "version": "2.17.0", + "resolved": "https://registry.npmjs.org/oauth4webapi/-/oauth4webapi-2.17.0.tgz", + "integrity": "sha512-lbC0Z7uzAFNFyzEYRIC+pkSVvDHJTbEW+dYlSBAlCYDe6RxUkJ26bClhk8ocBZip1wfI9uKTe0fm4Ib4RHn6uQ==", + "license": "MIT", "funding": { "url": "https://github.com/sponsors/panva" } @@ -11710,7 +11711,7 @@ }, "node_modules/openid-client": { "version": "5.7.1", - "resolved": "https://a0us.jfrog.io/artifactory/api/npm/npm/openid-client/-/openid-client-5.7.1.tgz", + "resolved": "https://registry.npmjs.org/openid-client/-/openid-client-5.7.1.tgz", "integrity": "sha512-jDBPgSVfTnkIh71Hg9pRvtJc6wTwqjRkN88+gCFtYWrlP4Yx2Dsrow8uPi3qLr/aeymPF3o2+dS+wOpglK04ew==", "license": "MIT", "dependencies": { @@ -23028,7 +23029,7 @@ }, "jose": { "version": "4.15.9", - "resolved": "https://a0us.jfrog.io/artifactory/api/npm/npm/jose/-/jose-4.15.9.tgz", + "resolved": "https://registry.npmjs.org/jose/-/jose-4.15.9.tgz", "integrity": "sha512-1vUQX+IdDMVPj4k8kOxgUqlcK518yluMuGZwqlr44FS1ppZB/5GWh4rZG89erpOBOJjU/OBsnCVFfapsRz6nEA==" }, "js-message": { @@ -23931,9 +23932,9 @@ "dev": true }, "oauth4webapi": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/oauth4webapi/-/oauth4webapi-2.4.0.tgz", - "integrity": "sha512-ZWl8ov8HeGVyc9Icl1cag76HvIcDAp23eIIT+UVGir+dEu8BMgMlvZeZwqLVd0P8DqaumH4N+QLQXN69G1QjSA==" + "version": "2.17.0", + "resolved": "https://registry.npmjs.org/oauth4webapi/-/oauth4webapi-2.17.0.tgz", + "integrity": "sha512-lbC0Z7uzAFNFyzEYRIC+pkSVvDHJTbEW+dYlSBAlCYDe6RxUkJ26bClhk8ocBZip1wfI9uKTe0fm4Ib4RHn6uQ==" }, "object-assign": { "version": "4.1.1", @@ -24109,7 +24110,7 @@ }, "openid-client": { "version": "5.7.1", - "resolved": "https://a0us.jfrog.io/artifactory/api/npm/npm/openid-client/-/openid-client-5.7.1.tgz", + "resolved": "https://registry.npmjs.org/openid-client/-/openid-client-5.7.1.tgz", "integrity": "sha512-jDBPgSVfTnkIh71Hg9pRvtJc6wTwqjRkN88+gCFtYWrlP4Yx2Dsrow8uPi3qLr/aeymPF3o2+dS+wOpglK04ew==", "requires": { "jose": "^4.15.9", diff --git a/package.json b/package.json index 7688ada89..78069d613 100644 --- a/package.json +++ b/package.json @@ -125,8 +125,8 @@ "debug": "^4.3.4", "joi": "^17.6.0", "jose": "^4.15.5", - "oauth4webapi": "^2.3.0", - "openid-client": "^5.6.5", + "oauth4webapi": "^2.17.0", + "openid-client": "^5.7.1", "tslib": "^2.4.0", "url-join": "^4.0.1" }, diff --git a/src/auth0-session/client/edge-client.ts b/src/auth0-session/client/edge-client.ts index 371f6ecf2..6b006b40d 100644 --- a/src/auth0-session/client/edge-client.ts +++ b/src/auth0-session/client/edge-client.ts @@ -96,7 +96,25 @@ export class EdgeClient extends AbstractClient { const [as, client] = await this.getClient(); if (this.config.pushedAuthorizationRequests) { - const response = await oauth.pushedAuthorizationRequest(as, client, parameters as Record); + const { clientAssertionSigningKey, clientAssertionSigningAlg } = this.config; + + let clientPrivateKey = clientAssertionSigningKey as CryptoKey | undefined; + /* c8 ignore next 3 */ + if (clientPrivateKey && !(clientPrivateKey instanceof CryptoKey)) { + clientPrivateKey = await jose.importPKCS8(clientPrivateKey, clientAssertionSigningAlg || 'RS256'); + } + + const response = await oauth.pushedAuthorizationRequest(as, client, parameters as Record, { + ...(clientPrivateKey && { + clientPrivateKey, + [oauth.modifyAssertion](_header: Record, payload: Record) { + if (Array.isArray(payload.aud)) { + payload.aud = as.issuer; + } + } + }), + ...this.httpOptions() + }); const result = await oauth.processPushedAuthorizationResponse(as, client, response); if (oauth.isOAuth2Error(result)) { throw new IdentityProviderError({ @@ -163,7 +181,14 @@ export class EdgeClient extends AbstractClient { checks.code_verifier as string, { additionalParameters: extras.exchangeBody, - ...(clientPrivateKey && { clientPrivateKey }), + ...(clientPrivateKey && { + clientPrivateKey, + [oauth.modifyAssertion](_header: Record, payload: Record) { + if (Array.isArray(payload.aud)) { + payload.aud = as.issuer; + } + } + }), ...this.httpOptions() } ); @@ -233,8 +258,25 @@ export class EdgeClient extends AbstractClient { async refresh(refreshToken: string, extras: { exchangeBody: Record }): Promise { const [as, client] = await this.getClient(); + + const { clientAssertionSigningKey, clientAssertionSigningAlg } = this.config; + + let clientPrivateKey = clientAssertionSigningKey as CryptoKey | undefined; + /* c8 ignore next 3 */ + if (clientPrivateKey && !(clientPrivateKey instanceof CryptoKey)) { + clientPrivateKey = await jose.importPKCS8(clientPrivateKey, clientAssertionSigningAlg || 'RS256'); + } + const res = await oauth.refreshTokenGrantRequest(as, client, refreshToken, { additionalParameters: extras.exchangeBody, + ...(clientPrivateKey && { + clientPrivateKey, + [oauth.modifyAssertion](_header: Record, payload: Record) { + if (Array.isArray(payload.aud)) { + payload.aud = as.issuer; + } + } + }), ...this.httpOptions() }); const result = await oauth.processRefreshTokenResponse(as, client, res); From d2297ba3efb2461819d9b2b820bd68ffeb16d152 Mon Sep 17 00:00:00 2001 From: Tushar Pandey Date: Wed, 4 Jun 2025 16:33:00 +0530 Subject: [PATCH 22/23] Release v3.8.0 (#2148) --- .version | 2 +- CHANGELOG.md | 12 ++++++++++++ package.json | 2 +- src/version.ts | 2 +- 4 files changed, 15 insertions(+), 3 deletions(-) diff --git a/.version b/.version index d1e9cf3bb..40c06ccb7 100644 --- a/.version +++ b/.version @@ -1 +1 @@ -v3.7.0 +v3.8.0 diff --git a/CHANGELOG.md b/CHANGELOG.md index 438be2e66..cab5f835b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,17 @@ # Change Log +## [v3.8.0](https://github.com/auth0/nextjs-auth0/tree/v3.8.0) (2025-06-04) +[Full Changelog](https://github.com/auth0/nextjs-auth0/compare/v3.7.0...v3.8.0) + +**Security** +Upgrade jose and openid-client to fix security vulnerabilities #2104 +refactor: use a single client assertion audience #2024 + +**Changed** +Update JSDocs to mention idpLogout defaults to true #2083 +Update useUser example to use a tag instead of Link #2087 +Add storeIDToken to config params docs #2103 + ## [v3.7.0](https://github.com/auth0/nextjs-auth0/tree/v3.7.0) (2025-03-24) [Full Changelog](https://github.com/auth0/nextjs-auth0/compare/v3.6.0...v3.7.0) diff --git a/package.json b/package.json index 78069d613..f6dcc3cd9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@auth0/nextjs-auth0", - "version": "3.7.0", + "version": "3.8.0", "description": "Next.js SDK for signing in with Auth0", "exports": { ".": "./dist/index.js", diff --git a/src/version.ts b/src/version.ts index e1d36212a..1f8df4fc1 100644 --- a/src/version.ts +++ b/src/version.ts @@ -1 +1 @@ -export default '3.7.0'; +export default '3.8.0'; From c3b281eddd9a77825fdf8948a838ebf23c9e58c1 Mon Sep 17 00:00:00 2001 From: Tushar Pandey Date: Tue, 10 Jun 2025 15:41:01 +0530 Subject: [PATCH 23/23] 1771 - Set id_token_hint when logging out (Signed) (#2151) Co-authored-by: simon-debruijn --- src/auth0-session/client/edge-client.ts | 2 +- src/auth0-session/client/node-client.ts | 2 +- .../auth0-session/client/edge-client.test.ts | 18 +++++++++++++++++ .../auth0-session/client/node-client.test.ts | 20 ++++++++++++++++++- 4 files changed, 39 insertions(+), 3 deletions(-) diff --git a/src/auth0-session/client/edge-client.ts b/src/auth0-session/client/edge-client.ts index 6b006b40d..f7b66af89 100644 --- a/src/auth0-session/client/edge-client.ts +++ b/src/auth0-session/client/edge-client.ts @@ -218,7 +218,7 @@ export class EdgeClient extends AbstractClient { this.config.idpLogout && (this.config.auth0Logout || (issuerUrl.hostname.match('\\.auth0\\.com$') && this.config.auth0Logout !== false)) ) { - const { id_token_hint, post_logout_redirect_uri, ...extraParams } = parameters; + const { post_logout_redirect_uri, ...extraParams } = parameters; const auth0LogoutUrl: URL = new URL(urlJoin(as.issuer, '/v2/logout')); post_logout_redirect_uri && auth0LogoutUrl.searchParams.set('returnTo', post_logout_redirect_uri); auth0LogoutUrl.searchParams.set('client_id', this.config.clientID); diff --git a/src/auth0-session/client/node-client.ts b/src/auth0-session/client/node-client.ts index d7f1f8d76..5a2811ca1 100644 --- a/src/auth0-session/client/node-client.ts +++ b/src/auth0-session/client/node-client.ts @@ -147,7 +147,7 @@ export class NodeClient extends AbstractClient { ) { Object.defineProperty(this.client, 'endSessionUrl', { value(params: EndSessionParameters) { - const { id_token_hint, post_logout_redirect_uri, ...extraParams } = params; + const { post_logout_redirect_uri, ...extraParams } = params; const parsedUrl = new URL(urlJoin(issuer.metadata.issuer, '/v2/logout')); parsedUrl.searchParams.set('client_id', config.clientID); post_logout_redirect_uri && parsedUrl.searchParams.set('returnTo', post_logout_redirect_uri); diff --git a/tests/auth0-session/client/edge-client.test.ts b/tests/auth0-session/client/edge-client.test.ts index 81718e5a3..090e0ccef 100644 --- a/tests/auth0-session/client/edge-client.test.ts +++ b/tests/auth0-session/client/edge-client.test.ts @@ -235,6 +235,24 @@ describe('edge client', function () { ); }); + it('should create custom logout for auth0 with id_token_hint', async function () { + nock('https://test.eu.auth0.com') + .get('/.well-known/openid-configuration') + .reply(200, { ...wellKnown, issuer: 'https://test.eu.auth0.com/', end_session_endpoint: undefined }); + nock('https://test.eu.auth0.com').get('/.well-known/jwks.json').reply(200, jwks); + + const client = await getClient({ + issuerBaseURL: 'https://test.eu.auth0.com', + idpLogout: true, + }); + + const idToken = await makeIdToken() + + await expect(client.endSessionUrl({ post_logout_redirect_uri: 'foo', id_token_hint: idToken })).resolves.toEqual( + `https://test.eu.auth0.com/v2/logout?returnTo=foo&client_id=__test_client_id__&id_token_hint=${idToken}` + ); + }); + it('should remove null params from oidc logout endpoint', async function () { const client = await getClient({ ...defaultConfig, idpLogout: true }); await expect(client.endSessionUrl({ foo: null } as any)).resolves.toEqual( diff --git a/tests/auth0-session/client/node-client.test.ts b/tests/auth0-session/client/node-client.test.ts index bb55d548e..51cee3943 100644 --- a/tests/auth0-session/client/node-client.test.ts +++ b/tests/auth0-session/client/node-client.test.ts @@ -1,6 +1,6 @@ import nock from 'nock'; import { getConfig, ConfigParameters } from '../../../src/auth0-session'; -import { jwks } from '../fixtures/cert'; +import { jwks, makeIdToken } from '../fixtures/cert'; import pkg from '../../../package.json'; import wellKnown from '../fixtures/well-known.json'; import version from '../../../src/version'; @@ -180,6 +180,24 @@ describe('node client', function () { ); }); + it('should create custom logout for auth0 with id_token_hint', async function () { + nock('https://test.eu.auth0.com') + .get('/.well-known/openid-configuration') + .reply(200, { ...wellKnown, issuer: 'https://test.eu.auth0.com/', end_session_endpoint: undefined }); + nock('https://test.eu.auth0.com').get('/.well-known/jwks.json').reply(200, jwks); + + const client = await getClient({ + issuerBaseURL: 'https://test.eu.auth0.com', + idpLogout: true, + }); + + const idToken = await makeIdToken() + + await expect(client.endSessionUrl({ post_logout_redirect_uri: 'foo', id_token_hint: idToken })).resolves.toEqual( + `https://test.eu.auth0.com/v2/logout?client_id=__test_client_id__&returnTo=foo&id_token_hint=${idToken}` + ); + }); + it('should handle limited openid-configuration', async function () { nock('https://op2.example.com') .get('/.well-known/openid-configuration')