From 9bdfd2552c29a63ebaa4b08352721d47a40429cf Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 7 Aug 2025 10:27:51 +0530 Subject: [PATCH 1/8] Bump tmp from 0.2.3 to 0.2.4 (#873) Bumps [tmp](https://github.com/raszi/node-tmp) from 0.2.3 to 0.2.4.
Commits

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=tmp&package-manager=npm_and_yarn&previous-version=0.2.3&new-version=0.2.4)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) ---
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) You can disable automated security fix PRs for this repo from the [Security Alerts page](https://github.com/auth0/auth0-react/network/alerts).
Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package-lock.json | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/package-lock.json b/package-lock.json index 52ad95af..e5c7a970 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11355,7 +11355,9 @@ "license": "MIT" }, "node_modules/tmp": { - "version": "0.2.3", + "version": "0.2.4", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.2.4.tgz", + "integrity": "sha512-UdiSoX6ypifLmrfQ/XfiawN6hkjSBpCjhKxxZcWlUUmoXLaCKQU0bx4HF/tdDK2uzRuchf1txGvrWBzYREssoQ==", "dev": true, "license": "MIT", "engines": { From 3db907ddb24dd6fee6c710244b70d737230f1e02 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 5 Sep 2025 10:31:55 +0530 Subject: [PATCH 2/8] Bump @typescript-eslint/parser from 8.37.0 to 8.42.0 (#885) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 8.37.0 to 8.42.0.
Release notes

Sourced from @​typescript-eslint/parser's releases.

v8.42.0

8.42.0 (2025-09-02)

🚀 Features

  • deprecate tseslint.config() (#11531)

🩹 Fixes

  • deps: update eslint monorepo to v9.33.0 (#11482)
  • typescript-eslint: handle non-normalized windows paths produced by jiti (#11546)

❤️ Thank You

You can read about our versioning strategy and releases on our website.

v8.41.0

8.41.0 (2025-08-25)

🚀 Features

  • tighten tsconfigRootDir validation (#11463)

❤️ Thank You

You can read about our versioning strategy and releases on our website.

v8.40.0

8.40.0 (2025-08-18)

🩹 Fixes

  • typescript-eslint: export plugin, parser, and configs that are compatible with both defineConfig() and tseslint.config() (#11475)
  • typescript-estree: correct range of import assertion with trailing comma (#11478)
  • utils: correct calculateConfigForFile return type (#11451)

❤️ Thank You

You can read about our versioning strategy and releases on our website.

v8.39.1

8.39.1 (2025-08-11)

... (truncated)

Changelog

Sourced from @​typescript-eslint/parser's changelog.

8.42.0 (2025-09-02)

This was a version bump only for parser to align it with other projects, there were no code changes.

You can read about our versioning strategy and releases on our website.

8.41.0 (2025-08-25)

This was a version bump only for parser to align it with other projects, there were no code changes.

You can read about our versioning strategy and releases on our website.

8.40.0 (2025-08-18)

This was a version bump only for parser to align it with other projects, there were no code changes.

You can read about our versioning strategy and releases on our website.

8.39.1 (2025-08-11)

This was a version bump only for parser to align it with other projects, there were no code changes.

You can read about our versioning strategy and releases on our website.

8.39.0 (2025-08-04)

🚀 Features

  • update to TypeScript 5.9.2 (#11445)

❤️ Thank You

You can read about our versioning strategy and releases on our website.

8.38.0 (2025-07-21)

This was a version bump only for parser to align it with other projects, there were no code changes.

You can read about our versioning strategy and releases on our website.

Commits
Maintainer changes

This version was pushed to npm by [GitHub Actions](https://www.npmjs.com/~GitHub Actions), a new releaser for @​typescript-eslint/parser since your current version.


[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=@typescript-eslint/parser&package-manager=npm_and_yarn&previous-version=8.37.0&new-version=8.42.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) ---
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package-lock.json | 173 +++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 165 insertions(+), 8 deletions(-) diff --git a/package-lock.json b/package-lock.json index e5c7a970..fe5d4519 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1810,16 +1810,16 @@ } }, "node_modules/@typescript-eslint/parser": { - "version": "8.37.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.37.0.tgz", - "integrity": "sha512-kVIaQE9vrN9RLCQMQ3iyRlVJpTiDUY6woHGb30JDkfJErqrQEmtdWH3gV0PBAfGZgQXoqzXOO0T3K6ioApbbAA==", + "version": "8.42.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.42.0.tgz", + "integrity": "sha512-r1XG74QgShUgXph1BYseJ+KZd17bKQib/yF3SR+demvytiRXrwd12Blnz5eYGm8tXaeRdd4x88MlfwldHoudGg==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/scope-manager": "8.37.0", - "@typescript-eslint/types": "8.37.0", - "@typescript-eslint/typescript-estree": "8.37.0", - "@typescript-eslint/visitor-keys": "8.37.0", + "@typescript-eslint/scope-manager": "8.42.0", + "@typescript-eslint/types": "8.42.0", + "@typescript-eslint/typescript-estree": "8.42.0", + "@typescript-eslint/visitor-keys": "8.42.0", "debug": "^4.3.4" }, "engines": { @@ -1831,7 +1831,164 @@ }, "peerDependencies": { "eslint": "^8.57.0 || ^9.0.0", - "typescript": ">=4.8.4 <5.9.0" + "typescript": ">=4.8.4 <6.0.0" + } + }, + "node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/project-service": { + "version": "8.42.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.42.0.tgz", + "integrity": "sha512-vfVpLHAhbPjilrabtOSNcUDmBboQNrJUiNAGoImkZKnMjs2TIcWG33s4Ds0wY3/50aZmTMqJa6PiwkwezaAklg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/tsconfig-utils": "^8.42.0", + "@typescript-eslint/types": "^8.42.0", + "debug": "^4.3.4" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "typescript": ">=4.8.4 <6.0.0" + } + }, + "node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/scope-manager": { + "version": "8.42.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.42.0.tgz", + "integrity": "sha512-51+x9o78NBAVgQzOPd17DkNTnIzJ8T/O2dmMBLoK9qbY0Gm52XJcdJcCl18ExBMiHo6jPMErUQWUv5RLE51zJw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/types": "8.42.0", + "@typescript-eslint/visitor-keys": "8.42.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/tsconfig-utils": { + "version": "8.42.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.42.0.tgz", + "integrity": "sha512-kHeFUOdwAJfUmYKjR3CLgZSglGHjbNTi1H8sTYRYV2xX6eNz4RyJ2LIgsDLKf8Yi0/GL1WZAC/DgZBeBft8QAQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "typescript": ">=4.8.4 <6.0.0" + } + }, + "node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/types": { + "version": "8.42.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.42.0.tgz", + "integrity": "sha512-LdtAWMiFmbRLNP7JNeY0SqEtJvGMYSzfiWBSmx+VSZ1CH+1zyl8Mmw1TT39OrtsRvIYShjJWzTDMPWZJCpwBlw==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/typescript-estree": { + "version": "8.42.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.42.0.tgz", + "integrity": "sha512-ku/uYtT4QXY8sl9EDJETD27o3Ewdi72hcXg1ah/kkUgBvAYHLwj2ofswFFNXS+FL5G+AGkxBtvGt8pFBHKlHsQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/project-service": "8.42.0", + "@typescript-eslint/tsconfig-utils": "8.42.0", + "@typescript-eslint/types": "8.42.0", + "@typescript-eslint/visitor-keys": "8.42.0", + "debug": "^4.3.4", + "fast-glob": "^3.3.2", + "is-glob": "^4.0.3", + "minimatch": "^9.0.4", + "semver": "^7.6.0", + "ts-api-utils": "^2.1.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "typescript": ">=4.8.4 <6.0.0" + } + }, + "node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/visitor-keys": { + "version": "8.42.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.42.0.tgz", + "integrity": "sha512-3WbiuzoEowaEn8RSnhJBrxSwX8ULYE9CXaPepS2C2W3NSA5NNIvBaslpBSBElPq0UGr0xVJlXFWOAKIkyylydQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/types": "8.42.0", + "eslint-visitor-keys": "^4.2.1" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/parser/node_modules/brace-expansion": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.2.tgz", + "integrity": "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/@typescript-eslint/parser/node_modules/eslint-visitor-keys": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.1.tgz", + "integrity": "sha512-Uhdk5sfqcee/9H/rCOJikYz67o0a2Tw2hGRPOG2Y1R2dg7brRe1uG0yaNQDHu+TO/uQPF/5eCapvYSmHUjt7JQ==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/@typescript-eslint/parser/node_modules/minimatch": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", + "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" } }, "node_modules/@typescript-eslint/project-service": { From aae1b2a28867257a26a9aa53ebbc654b8ebda0dd Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 5 Sep 2025 10:37:48 +0530 Subject: [PATCH 3/8] Bump form-data from 4.0.1 to 4.0.4 (#866) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bumps [form-data](https://github.com/form-data/form-data) from 4.0.1 to 4.0.4.
Changelog

Sourced from form-data's changelog.

v4.0.4 - 2025-07-16

Commits

  • [meta] add auto-changelog 811f682
  • [Tests] handle predict-v8-randomness failures in node < 17 and node > 23 1d11a76
  • [Fix] Switch to using crypto random for boundary values 3d17230
  • [Tests] fix linting errors 5e34080
  • [meta] actually ensure the readme backup isn’t published 316c82b
  • [Dev Deps] update @ljharb/eslint-config 58c25d7
  • [meta] fix readme capitalization 2300ca1

v4.0.3 - 2025-06-05

Fixed

Commits

  • [eslint] use a shared config 426ba9a
  • [eslint] fix some spacing issues 2094191
  • [Refactor] use hasown 81ab41b
  • [Fix] validate boundary type in setBoundary() method 8d8e469
  • [Tests] add tests to check the behavior of getBoundary with non-strings 837b8a1
  • [Dev Deps] remove unused deps 870e4e6
  • [meta] remove local commit hooks e6e83cc
  • [Dev Deps] update eslint 4066fd6
  • [meta] fix scripts to use prepublishOnly c4bbb13

v4.0.2 - 2025-02-14

Merged

Fixed

Commits

  • Merge tags v2.5.3 and v3.0.3 92613b9
  • [Tests] migrate from travis to GHA 806eda7
  • [Tests] migrate from travis to GHA 8fdb3bc

... (truncated)

Commits
  • 41996f5 v4.0.4
  • 316c82b [meta] actually ensure the readme backup isn’t published
  • 2300ca1 [meta] fix readme capitalization
  • 811f682 [meta] add auto-changelog
  • 5e34080 [Tests] fix linting errors
  • 1d11a76 [Tests] handle predict-v8-randomness failures in node < 17 and node > 23
  • 58c25d7 [Dev Deps] update @ljharb/eslint-config
  • 3d17230 [Fix] Switch to using crypto random for boundary values
  • d8d67dc v4.0.3
  • e6e83cc [meta] remove local commit hooks
  • Additional commits viewable in compare view

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=form-data&package-manager=npm_and_yarn&previous-version=4.0.1&new-version=4.0.4)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) You can trigger a rebase of this PR by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) ---
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) You can disable automated security fix PRs for this repo from the [Security Alerts page](https://github.com/auth0/auth0-react/network/alerts).
> **Note** > Automatic rebases have been disabled on this pull request as it has been open for over 30 days. Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Gyanesh Gouraw <160731216+gyaneshgouraw-okta@users.noreply.github.com> --- package-lock.json | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/package-lock.json b/package-lock.json index fe5d4519..1ddd8a28 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5549,12 +5549,16 @@ } }, "node_modules/form-data": { - "version": "4.0.1", + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.4.tgz", + "integrity": "sha512-KrGhL9Q4zjj0kiUt5OO4Mr/A/jlI2jDYs5eHBpYHPcBEVSiipAvn2Ko2HnPe20rmcuuvMHNdZFp+4IlGTMF0Ow==", "dev": true, "license": "MIT", "dependencies": { "asynckit": "^0.4.0", "combined-stream": "^1.0.8", + "es-set-tostringtag": "^2.1.0", + "hasown": "^2.0.2", "mime-types": "^2.1.12" }, "engines": { From 712be5be3b8c7df8b8ddfed6e389e1c1461a35f7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 5 Sep 2025 10:48:26 +0530 Subject: [PATCH 4/8] Bump next from 15.3.5 to 15.4.7 in /examples/nextjs-app (#883) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bumps [next](https://github.com/vercel/next.js) from 15.3.5 to 15.4.7.
Release notes

Sourced from next's releases.

v15.4.7

[!NOTE]
This release is backporting bug fixes. It does not include all pending features/changes on canary.

Core Changes

  • fix router handling when setting a location response header #82588

Credits

Huge thanks to @​ztanner for helping!

v15.4.6

[!NOTE]
This release is backporting bug fixes. It does not include all pending features/changes on canary.

Core Changes

  • fix: _error page's req.url can be overwritten to dynamic param on minimal mode (#82347)
  • fix: add ?dpl to fonts in /_next/static/media (#82384)

Credits

Huge thanks to @​devjiwonchoi, @​ijjk, and @​styfle for helping!

v15.4.5

[!NOTE]
This release is backporting bug fixes. It does not include all pending features/changes on canary.

Core Changes

  • Fix API stripping JSON incorrectly (#82062)
  • Fix i18n fallback: false collision (#82158)
  • Revert "Fix tracing of server actions imported by client components (#82167)
  • Ensure setAssetPrefix updates config instance (#82165)
  • Turbopack: update mimalloc (#82166)
  • fix(next/image): fix image-optimizer.ts headers (#82175)
  • fix(next/image): improve and simplify detect-content-type (#82174)

Credits

Huge thanks to @​ijjk, @​sokra, and @​styfle for helping!

v15.4.4

[!NOTE]
This release is backporting bug fixes. It does not include all pending features/changes on canary.

Core Changes

  • Fix dynamicParams false layout case in dev (#82026)
  • Turbopack: fix scope hoisting variable renaming bug (#81640)
  • Upgrade to swc v33 (#81750)
  • Revert "[metadata] use https protocol for schema urls" (#81934)

... (truncated)

Commits

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=next&package-manager=npm_and_yarn&previous-version=15.3.5&new-version=15.4.7)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) ---
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) You can disable automated security fix PRs for this repo from the [Security Alerts page](https://github.com/auth0/auth0-react/network/alerts).
Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Gyanesh Gouraw <160731216+gyaneshgouraw-okta@users.noreply.github.com> --- examples/nextjs-app/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/nextjs-app/package.json b/examples/nextjs-app/package.json index 79546bb1..93eef4ac 100644 --- a/examples/nextjs-app/package.json +++ b/examples/nextjs-app/package.json @@ -9,7 +9,7 @@ }, "dependencies": { "@auth0/auth0-react": "file:../..", - "next": "15.3.5", + "next": "15.4.7", "react": "file:../../node_modules/react", "react-dom": "file:../../node_modules/react-dom" } From c673ced62c2969794d94df53ef07b00e41df7fde Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 5 Sep 2025 10:51:33 +0530 Subject: [PATCH 5/8] Bump @testing-library/react from 16.1.0 to 16.3.0 (#861) [![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=@testing-library/react&package-manager=npm_and_yarn&previous-version=16.1.0&new-version=16.3.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) You can trigger a rebase of this PR by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) ---
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
> **Note** > Automatic rebases have been disabled on this pull request as it has been open for over 30 days. Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Gyanesh Gouraw <160731216+gyaneshgouraw-okta@users.noreply.github.com> --- package-lock.json | 6 ++++-- package.json | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 1ddd8a28..3b62b361 100644 --- a/package-lock.json +++ b/package-lock.json @@ -17,7 +17,7 @@ "@rollup/plugin-terser": "^0.4.3", "@testing-library/dom": "^10.4.0", "@testing-library/jest-dom": "6.6.3", - "@testing-library/react": "16.1.0", + "@testing-library/react": "16.3.0", "@types/jest": "^29.5.14", "@types/react": "19.1.8", "@types/react-dom": "19.1.6", @@ -1501,7 +1501,9 @@ "license": "MIT" }, "node_modules/@testing-library/react": { - "version": "16.1.0", + "version": "16.3.0", + "resolved": "https://registry.npmjs.org/@testing-library/react/-/react-16.3.0.tgz", + "integrity": "sha512-kFSyxiEDwv1WLl2fgsq6pPBbw5aWKrsY2/noi1Id0TK0UParSF62oFQFGHXIyaG4pp2tEub/Zlel+fjjZILDsw==", "dev": true, "license": "MIT", "dependencies": { diff --git a/package.json b/package.json index 7d055e55..1484f0f0 100644 --- a/package.json +++ b/package.json @@ -56,7 +56,7 @@ "@rollup/plugin-terser": "^0.4.3", "@testing-library/dom": "^10.4.0", "@testing-library/jest-dom": "6.6.3", - "@testing-library/react": "16.1.0", + "@testing-library/react": "16.3.0", "@types/jest": "^29.5.14", "@types/react": "19.1.8", "@types/react-dom": "19.1.6", From 10682152bd09b3007c59b1a65d1a7985461e9bfe Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 5 Sep 2025 10:54:19 +0530 Subject: [PATCH 6/8] Bump rollup-plugin-delete from 2.1.0 to 2.2.0 (#859) [![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=rollup-plugin-delete&package-manager=npm_and_yarn&previous-version=2.1.0&new-version=2.2.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) You can trigger a rebase of this PR by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) ---
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
> **Note** > Automatic rebases have been disabled on this pull request as it has been open for over 30 days. Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Gyanesh Gouraw <160731216+gyaneshgouraw-okta@users.noreply.github.com> --- package-lock.json | 95 ++++++++++++++++++++++------------------------- 1 file changed, 44 insertions(+), 51 deletions(-) diff --git a/package-lock.json b/package-lock.json index 3b62b361..121ca60e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1583,15 +1583,6 @@ "dev": true, "license": "MIT" }, - "node_modules/@types/glob": { - "version": "7.2.0", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/minimatch": "*", - "@types/node": "*" - } - }, "node_modules/@types/graceful-fs": { "version": "4.1.9", "dev": true, @@ -1684,11 +1675,6 @@ "parse5": "^7.0.0" } }, - "node_modules/@types/minimatch": { - "version": "5.1.2", - "dev": true, - "license": "MIT" - }, "node_modules/@types/node": { "version": "22.10.6", "dev": true, @@ -2526,6 +2512,8 @@ }, "node_modules/array-union": { "version": "2.1.0", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", + "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", "dev": true, "license": "MIT", "engines": { @@ -4351,50 +4339,26 @@ } }, "node_modules/del": { - "version": "5.1.0", + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/del/-/del-6.1.1.tgz", + "integrity": "sha512-ua8BhapfP0JUJKC/zV9yHHDW/rDoDxP4Zhn3AkA6/xT6gY7jYXJiaeyBZznYVujhZZET+UgcbZiQ7sN3WqcImg==", "dev": true, "license": "MIT", "dependencies": { - "globby": "^10.0.1", - "graceful-fs": "^4.2.2", + "globby": "^11.0.1", + "graceful-fs": "^4.2.4", "is-glob": "^4.0.1", "is-path-cwd": "^2.2.0", - "is-path-inside": "^3.0.1", - "p-map": "^3.0.0", - "rimraf": "^3.0.0", - "slash": "^3.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/del/node_modules/globby": { - "version": "10.0.2", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/glob": "^7.1.1", - "array-union": "^2.1.0", - "dir-glob": "^3.0.1", - "fast-glob": "^3.0.3", - "glob": "^7.1.3", - "ignore": "^5.1.1", - "merge2": "^1.2.3", + "is-path-inside": "^3.0.2", + "p-map": "^4.0.0", + "rimraf": "^3.0.2", "slash": "^3.0.0" }, "engines": { - "node": ">=8" - } - }, - "node_modules/del/node_modules/p-map": { - "version": "3.0.0", - "dev": true, - "license": "MIT", - "dependencies": { - "aggregate-error": "^3.0.0" + "node": ">=10" }, - "engines": { - "node": ">=8" + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/delayed-stream": { @@ -4461,6 +4425,8 @@ }, "node_modules/dir-glob": { "version": "3.0.1", + "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", + "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", "dev": true, "license": "MIT", "dependencies": { @@ -5882,6 +5848,27 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/globby": { + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", + "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", + "dev": true, + "license": "MIT", + "dependencies": { + "array-union": "^2.1.0", + "dir-glob": "^3.0.1", + "fast-glob": "^3.2.9", + "ignore": "^5.2.0", + "merge2": "^1.4.1", + "slash": "^3.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/gopd": { "version": "1.2.0", "dev": true, @@ -6609,6 +6596,8 @@ }, "node_modules/is-path-cwd": { "version": "2.2.0", + "resolved": "https://registry.npmjs.org/is-path-cwd/-/is-path-cwd-2.2.0.tgz", + "integrity": "sha512-w942bTcih8fdJPJmQHFzkS76NEP8Kzzvmw92cXsazb8intwLqPibPPdXf4ANdKV3rYMuuQYGIWtvz9JilB3NFQ==", "dev": true, "license": "MIT", "engines": { @@ -9533,6 +9522,8 @@ }, "node_modules/path-type": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", + "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", "dev": true, "license": "MIT", "engines": { @@ -10428,11 +10419,13 @@ } }, "node_modules/rollup-plugin-delete": { - "version": "2.1.0", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/rollup-plugin-delete/-/rollup-plugin-delete-2.2.0.tgz", + "integrity": "sha512-REKtDKWvjZlbrWpPvM9X/fadCs3E9I9ge27AK8G0e4bXwSLeABAAwtjiI1u3ihqZxk6mJeB2IVeSbH4DtOcw7A==", "dev": true, "license": "MIT", "dependencies": { - "del": "^5.1.0" + "del": "^6.1.1" }, "engines": { "node": ">=10" From 1d5e69f1af559b000455329205081e9a899cbc62 Mon Sep 17 00:00:00 2001 From: martinml <217925+martinml@users.noreply.github.com> Date: Mon, 15 Sep 2025 10:01:19 +0200 Subject: [PATCH 7/8] Add support for DPoP (#869) ### Description This PR adds support for DPoP via an update of `auth0-spa-js` from 2.3.0 to 2.4.1. New methods are exposed, docs are updated. No logic changes. ### Testing - [x] This change adds test coverage for new/changed/fixed functionality ### Checklist - [x] I have added documentation for new/changed functionality in this PR or in auth0.com/docs - [x] All active GitHub checks for tests, formatting, and security are passing - [x] The correct base branch is being used, if not the default branch --------- Co-authored-by: Rita Zerrizuela Co-authored-by: Gyanesh Gouraw --- EXAMPLES.md | 232 +++++++++++++++++ __mocks__/@auth0/auth0-spa-js.tsx | 8 + __tests__/auth-provider.test.tsx | 49 ++++ package-lock.json | 396 +++++++----------------------- package.json | 2 +- src/auth0-context.tsx | 50 ++++ src/auth0-provider.tsx | 28 +++ src/index.tsx | 4 +- 8 files changed, 461 insertions(+), 308 deletions(-) diff --git a/EXAMPLES.md b/EXAMPLES.md index cd29491f..0637ee52 100644 --- a/EXAMPLES.md +++ b/EXAMPLES.md @@ -8,6 +8,7 @@ - [Protecting a route in a Next.js app (in SPA mode)](#protecting-a-route-in-a-nextjs-app-in-spa-mode) - [Use with Auth0 organizations](#use-with-auth0-organizations) - [Protecting a route with a claims check](#protecting-a-route-with-a-claims-check) +- [Device-bound tokens with DPoP](#device-bound-tokens-with-dpop) ## Use with a Class Component @@ -339,3 +340,234 @@ const Page = withAuthenticationRequired( withClaimCheck(Component, checkClaims, '/missing-roles' ) ); ``` + +## Device-bound tokens with DPoP + +**Demonstrating Proof-of-Possession** —or simply **DPoP**— is a recent OAuth 2.0 extension defined in [RFC9449](https://datatracker.ietf.org/doc/html/rfc9449). + +It defines a mechanism for securely binding tokens to a specific device using cryptographic signatures. Without it, **a token leak caused by XSS or other vulnerabilities could allow an attacker to impersonate the real user.** + +To support DPoP in `auth0-react`, some APIs available in modern browsers are required: + +- [Crypto API](https://developer.mozilla.org/en-US/docs/Web/API/Crypto): allows to create and use cryptographic keys, which are used to generate the proofs (i.e. signatures) required for DPoP. + +- [IndexedDB](https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API): enables the use of cryptographic keys [without exposing the private material](https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto#storing_keys). + +The following OAuth 2.0 flows are currently supported by `auth0-react`: + +- [Authorization Code Flow](https://auth0.com/docs/get-started/authentication-and-authorization-flow/authorization-code-flow) (`authorization_code`). + +- [Refresh Token Flow](https://auth0.com/docs/secure/tokens/refresh-tokens) (`refresh_token`). + +- [Custom Token Exchange Flow](https://auth0.com/docs/authenticate/custom-token-exchange) (`urn:ietf:params:oauth:grant-type:token-exchange`). + +> [!IMPORTANT] +> Currently, only the `ES256` algorithm is supported. + +### Enabling DPoP + +DPoP is disabled by default. To enable it, set the `useDpop` option to `true` when invoking the provider. For example: + +```jsx + +``` + +After enabling DPoP, **every new session using a supported OAuth 2.0 flow in Auth0 will begin transparently to use tokens that are cryptographically bound to the current browser**. + +> [!IMPORTANT] +> DPoP will only be used for new user sessions created after enabling it. Any previously existing sessions will continue using non-DPoP tokens until the user logs in again. +> +> You decide how to handle this transition. For example, you might require users to log in again the next time they use your application. + +> [!NOTE] +> Using DPoP requires storing some temporary data in the user's browser. When you log the user out with `logout()`, this data is deleted. + +> [!TIP] +> If all your clients are already using DPoP, you may want to increase security by making Auth0 reject any non-DPoP interactions. See [the docs on Sender Constraining](https://auth0.com/docs/secure/sender-constraining/configure-sender-constraining) for details. + +### Using DPoP in your own requests + +You use a DPoP token the same way as a "traditional" access token, except it must be sent to the server with an `Authorization: DPoP ` header instead of the usual `Authorization: Bearer `. + +To determine the type of a token, use the `detailedResponse` option in `getAccessTokenSilently()` to access the `token_type` property, which will be either `DPoP` or `Bearer`. + +For internal requests sent by `auth0-react` to Auth0, simply enable the `useDpop` option and **every interaction with Auth0 will be protected**. + +However, **to use DPoP with a custom, external API, some additional work is required**. The `useAuth()` hook provides some low-level methods to help with this: + +- `getDpopNonce()` +- `setDpopNonce()` +- `generateDpopProof()` + +However, due to the nature of how DPoP works, **this is not a trivial task**: + +- When a nonce is missing or expired, the request may need to be retried. +- Received nonces must be stored and managed. +- DPoP headers must be generated and included in every request, and regenerated for retries. + +Because of this, we recommend using the provided `fetchWithAuth()` method, which **handles all of this for you**. + +#### Simple usage + +The `fetchWithAuth()` method is a drop-in replacement for the native `fetch()` function from the Fetch API, so if you're already using it, the change will be minimal. + +For example, if you had this code: + +```js +await fetch('https://api.example.com/foo', { + method: 'GET', + headers: { 'user-agent': 'My Client 1.0' } +}); + +console.log(response.status); +console.log(response.headers); +console.log(await response.json()); +``` + +You would change it as follows: + +```js +const { createFetcher } = useAuth0(); + +const fetcher = createFetcher({ + dpopNonceId: 'my_api_request' +}); + +await fetcher.fetchWithAuth('https://api.example.com/foo', { + method: 'GET', + headers: { 'user-agent': 'My Client 1.0' } +}); + +console.log(response.status); +console.log(response.headers); +console.log(await response.json()); +``` + +When using `fetchWithAuth()`, the following will be handled for you automatically: + +- Use `getAccessTokenSilently()` to get the access token to inject in the headers. +- Generate and inject DPoP headers when needed. +- Store and update any DPoP nonces. +- Handle retries caused by a rejected nonce. + +> [!IMPORTANT] +> If DPoP is enabled in the provider, a `dpopNonceId` **must** be present in the `createFetcher()` parameters, since it’s used to keep track of the DPoP nonces for each request. + +#### Advanced usage + +If you need something more complex than the example above, you can provide a custom implementation in the `fetch` property. + +However, since `auth0-react` needs to make decisions based on HTTP responses, your implementation **must return an object with _at least_ two properties**: + +1. `status`: the response status code as a number. +2. `headers`: the response headers as a plain object or as a Fetch API’s Headers-like interface. + +Whatever it returns, it will be passed as the output of the `fetchWithAuth()` method. + +Your implementation will be called with a standard, ready-to-use [Request](https://developer.mozilla.org/en-US/docs/Web/API/Request) object, which will contain any headers needed for authorization and DPoP usage (if enabled). Depending on your needs, you can use this object directly or treat it as a container with everything required to make the request your own way. + +##### Example with `axios` + +```js +const { createFetcher } = useAuth0(); + +const fetcher = createFetcher({ + dpopNonceId: 'my_api_request', + fetch: (request) => + // The `Request` object has everything you need to do a request in a + // different library. Make sure that your output meets the requirements + // about the `status` and `headers` properties. + axios.request({ + url: request.url, + method: request.method, + data: request.body, + headers: Object.fromEntries(request.headers), + timeout: 2000, + // etc. + }), + }, +}); + +const response = await fetcher.fetchWithAuth('https://api.example.com/foo', { + method: 'POST', + body: JSON.stringify({ name: 'John Doe' }), + headers: { 'user-agent': 'My Client 1.0' }, +}); + +console.log(response.status); +console.log(response.headers); +console.log(response.data); +``` + +##### Timeouts with native `fetch()` + +The Fetch API doesn’t support passing a timeout value directly; instead, you’re expected to use an [AbortSignal](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). For example: + +```js +const { createFetcher } = useAuth0(); + +const fetcher = createFetcher(); + +await fetcher.fetchWithAuth('https://api.example.com/foo', { + signal: AbortSignal.timeout(2000) +}); +``` + +This works, but if you define your request parameters statically when your app starts and then call `fetchWithAuth()` after an indeterminate amount of time, you'll find that **the request will timeout immediately**. This happens because the `AbortSignal` **starts counting time as soon as it is created**. + +To work around this, you can pass a thin wrapper over the native `fetch()` so that a new `AbortSignal` is created each time a request is made: + +```js +const { createFetcher } = useAuth0(); + +const fetcher = createFetcher({ + fetch: (request) => fetch(request, { signal: AbortSignal.timeout(2000) }) +}); + +await fetcher.fetchWithAuth('https://api.example.com/foo'); +``` + +##### Having a base URL + +If you need to make requests to different endpoints of the same API, passing a `baseUrl` to `createFetcher()` can be useful: + +```js +const { createFetcher } = useAuth0(); + +const fetcher = createFetcher({ + baseUrl: 'https://api.example.com' +}); + +await fetcher.fetchWithAuth('/foo'); // => https://api.example.com/foo +await fetcher.fetchWithAuth('/bar'); // => https://api.example.com/bar +await fetcher.fetchWithAuth('/xyz'); // => https://api.example.com/xyz + +// If the passed URL is absolute, `baseUrl` will be ignored for convenience: +await fetcher.fetchWithAuth('https://other-api.example.com/foo'); +``` + +##### Passing an access token + +The `fetchWithAuth()` method assumes you’re using the SDK to get the access token for the request. This means that by default, it will always call `getAccessTokenSilently()` internally before making the request. + +However, if you already have an access token or need to pass specific parameters to `getAccessTokenSilently()`, you can override this behavior with a custom access token factory, like so: + +```js +const { createFetcher, getAccessTokenSilently } = useAuth0(); + +createFetcher({ + getAccessToken: () => + getAccessTokenSilently({ + authorizationParams: { + audience: '', + scope: '' + // etc. + } + }) +}); +``` diff --git a/__mocks__/@auth0/auth0-spa-js.tsx b/__mocks__/@auth0/auth0-spa-js.tsx index b19548ad..713e5d6d 100644 --- a/__mocks__/@auth0/auth0-spa-js.tsx +++ b/__mocks__/@auth0/auth0-spa-js.tsx @@ -10,6 +10,10 @@ const isAuthenticated = jest.fn(() => false); const loginWithPopup = jest.fn(); const loginWithRedirect = jest.fn(); const logout = jest.fn(); +const getDpopNonce = jest.fn(); +const setDpopNonce = jest.fn(); +const generateDpopProof = jest.fn(); +const createFetcher = jest.fn(); export const Auth0Client = jest.fn(() => { return { @@ -25,5 +29,9 @@ export const Auth0Client = jest.fn(() => { loginWithPopup, loginWithRedirect, logout, + getDpopNonce, + setDpopNonce, + generateDpopProof, + createFetcher, }; }); diff --git a/__tests__/auth-provider.test.tsx b/__tests__/auth-provider.test.tsx index ee506f8b..143d6422 100644 --- a/__tests__/auth-provider.test.tsx +++ b/__tests__/auth-provider.test.tsx @@ -522,6 +522,7 @@ describe('Auth0Provider', () => { access_token: '123', id_token: '456', expires_in: 2, + token_type: 'Bearer', }; (clientMock.getTokenSilently as jest.Mock).mockResolvedValue(tokenResponse); const wrapper = createWrapper(); @@ -940,6 +941,54 @@ describe('Auth0Provider', () => { }); }); + it('should provide a getDpopNonce method', async () => { + const wrapper = createWrapper(); + const { result } = renderHook(() => useContext(Auth0Context), { wrapper }); + + expect(result.current.getDpopNonce).toBeInstanceOf(Function); + await act(() => result.current.getDpopNonce()); + expect(clientMock.getDpopNonce).toHaveBeenCalled(); + }); + + it('should provide a setDpopNonce method', async () => { + const wrapper = createWrapper(); + const { result } = renderHook(() => useContext(Auth0Context), { wrapper }); + + const nonce = 'n-123456'; + const id = 'my-nonce'; + + expect(result.current.setDpopNonce).toBeInstanceOf(Function); + await act(() => result.current.setDpopNonce(nonce, id)); + expect(clientMock.setDpopNonce).toHaveBeenCalledWith(nonce, id); + }); + + it('should provide a generateDpopProof method', async () => { + const wrapper = createWrapper(); + const { result } = renderHook(() => useContext(Auth0Context), { wrapper }); + + const params = { + url: 'https://api.example.com/foo', + method: 'GET', + nonce: 'n-123456', + accessToken: 'at-123456', + }; + + expect(result.current.generateDpopProof).toBeInstanceOf(Function); + await act(() => result.current.generateDpopProof(params)); + expect(clientMock.generateDpopProof).toHaveBeenCalledWith(params); + }); + + it('should provide a createFetcher method', async () => { + const wrapper = createWrapper(); + const { result } = renderHook(() => useContext(Auth0Context), { wrapper }); + + const config = { dpopNonceId: 'my_dpop_nonce_test_id' }; + + expect(result.current.createFetcher).toBeInstanceOf(Function); + await act(() => result.current.createFetcher(config)); + expect(clientMock.createFetcher).toHaveBeenCalledWith(config); + }); + it('should not update context value after rerender with no state change', async () => { clientMock.getTokenSilently.mockReturnThis(); clientMock.getUser.mockResolvedValue({ name: 'foo' }); diff --git a/package-lock.json b/package-lock.json index 121ca60e..1ed60ce7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,7 +9,7 @@ "version": "2.4.0", "license": "MIT", "dependencies": { - "@auth0/auth0-spa-js": "^2.2.0" + "@auth0/auth0-spa-js": "^2.4.1" }, "devDependencies": { "@rollup/plugin-node-resolve": "^15.0.1", @@ -74,10 +74,14 @@ } }, "node_modules/@auth0/auth0-spa-js": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/@auth0/auth0-spa-js/-/auth0-spa-js-2.3.0.tgz", - "integrity": "sha512-zAW6w79UO+G1+3AxboVQIUIZy05xluSOb1ymGg2dqG0pIi0JxEtZGec05BOf2LJ9SehzW4WeCYUQsYD9BjrVpQ==", - "license": "MIT" + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/@auth0/auth0-spa-js/-/auth0-spa-js-2.4.1.tgz", + "integrity": "sha512-GE1XPLEgEUeqYBw5VcA52+3ubJDh4VKZFqdu0mr6h7anu+rFZb389cDbfpW145I23T1knZB/jvQtuRrkcLuT+Q==", + "dependencies": { + "browser-tabs-lock": "^1.2.15", + "dpop": "^2.1.1", + "es-cookie": "~1.3.2" + } }, "node_modules/@babel/code-frame": { "version": "7.26.2", @@ -588,8 +592,6 @@ }, "node_modules/@eslint-community/eslint-utils": { "version": "4.7.0", - "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.7.0.tgz", - "integrity": "sha512-dyybb3AcajC7uha6CvhdVRJqaKyn7w2YKqKyAN37NKYgZT36w+iRb0Dymmc5qEJ549c/S31cMMSFd75bteCpCw==", "dev": true, "license": "MIT", "dependencies": { @@ -645,8 +647,6 @@ }, "node_modules/@gerrit0/mini-shiki": { "version": "3.7.0", - "resolved": "https://registry.npmjs.org/@gerrit0/mini-shiki/-/mini-shiki-3.7.0.tgz", - "integrity": "sha512-7iY9wg4FWXmeoFJpUL2u+tsmh0d0jcEJHAIzVxl3TG4KL493JNnisdLAILZ77zcD+z3J0keEXZ+lFzUgzQzPDg==", "dev": true, "license": "MIT", "dependencies": { @@ -1338,8 +1338,6 @@ }, "node_modules/@shikijs/engine-oniguruma": { "version": "3.7.0", - "resolved": "https://registry.npmjs.org/@shikijs/engine-oniguruma/-/engine-oniguruma-3.7.0.tgz", - "integrity": "sha512-5BxcD6LjVWsGu4xyaBC5bu8LdNgPCVBnAkWTtOCs/CZxcB22L8rcoWfv7Hh/3WooVjBZmFtyxhgvkQFedPGnFw==", "dev": true, "license": "MIT", "dependencies": { @@ -1349,8 +1347,6 @@ }, "node_modules/@shikijs/langs": { "version": "3.7.0", - "resolved": "https://registry.npmjs.org/@shikijs/langs/-/langs-3.7.0.tgz", - "integrity": "sha512-1zYtdfXLr9xDKLTGy5kb7O0zDQsxXiIsw1iIBcNOO8Yi5/Y1qDbJ+0VsFoqTlzdmneO8Ij35g7QKF8kcLyznCQ==", "dev": true, "license": "MIT", "dependencies": { @@ -1359,8 +1355,6 @@ }, "node_modules/@shikijs/themes": { "version": "3.7.0", - "resolved": "https://registry.npmjs.org/@shikijs/themes/-/themes-3.7.0.tgz", - "integrity": "sha512-VJx8497iZPy5zLiiCTSIaOChIcKQwR0FebwE9S3rcN0+J/GTWwQ1v/bqhTbpbY3zybPKeO8wdammqkpXc4NVjQ==", "dev": true, "license": "MIT", "dependencies": { @@ -1369,8 +1363,6 @@ }, "node_modules/@shikijs/types": { "version": "3.7.0", - "resolved": "https://registry.npmjs.org/@shikijs/types/-/types-3.7.0.tgz", - "integrity": "sha512-MGaLeaRlSWpnP0XSAum3kP3a8vtcTsITqoEPYdt3lQG3YCdQH4DnEhodkYcNMcU0uW0RffhoD1O3e0vG5eSBBg==", "dev": true, "license": "MIT", "dependencies": { @@ -1380,8 +1372,6 @@ }, "node_modules/@shikijs/vscode-textmate": { "version": "10.0.2", - "resolved": "https://registry.npmjs.org/@shikijs/vscode-textmate/-/vscode-textmate-10.0.2.tgz", - "integrity": "sha512-83yeghZ2xxin3Nj8z1NMd/NCuca+gsYXswywDy5bHvwlWL8tpTQmzGeUuHd9FC3E/SBEMvzJRwWEOz5gGes9Qg==", "dev": true, "license": "MIT" }, @@ -1505,7 +1495,6 @@ "resolved": "https://registry.npmjs.org/@testing-library/react/-/react-16.3.0.tgz", "integrity": "sha512-kFSyxiEDwv1WLl2fgsq6pPBbw5aWKrsY2/noi1Id0TK0UParSF62oFQFGHXIyaG4pp2tEub/Zlel+fjjZILDsw==", "dev": true, - "license": "MIT", "dependencies": { "@babel/runtime": "^7.12.5" }, @@ -1583,6 +1572,15 @@ "dev": true, "license": "MIT" }, + "node_modules/@types/glob": { + "version": "7.2.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/minimatch": "*", + "@types/node": "*" + } + }, "node_modules/@types/graceful-fs": { "version": "4.1.9", "dev": true, @@ -1593,8 +1591,6 @@ }, "node_modules/@types/hast": { "version": "3.0.4", - "resolved": "https://registry.npmjs.org/@types/hast/-/hast-3.0.4.tgz", - "integrity": "sha512-WPs+bbQw5aCj+x6laNGWLH3wviHtoCv/P3+otBhbOhJgG8qtpdAMlTCxLtsTWA7LH1Oh/bFCHsBn0TPS5m30EQ==", "dev": true, "license": "MIT", "dependencies": { @@ -1675,6 +1671,11 @@ "parse5": "^7.0.0" } }, + "node_modules/@types/minimatch": { + "version": "5.1.2", + "dev": true, + "license": "MIT" + }, "node_modules/@types/node": { "version": "22.10.6", "dev": true, @@ -1685,8 +1686,6 @@ }, "node_modules/@types/react": { "version": "19.1.8", - "resolved": "https://registry.npmjs.org/@types/react/-/react-19.1.8.tgz", - "integrity": "sha512-AwAfQ2Wa5bCx9WP8nZL2uMZWod7J7/JSplxbTmBQ5ms6QpqNYm672H0Vu9ZVKVngQ+ii4R/byguVEUZQyeg44g==", "dev": true, "license": "MIT", "dependencies": { @@ -1695,8 +1694,6 @@ }, "node_modules/@types/react-dom": { "version": "19.1.6", - "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-19.1.6.tgz", - "integrity": "sha512-4hOiT/dwO8Ko0gV1m/TJZYk3y0KBnY9vzDh7W+DH17b2HFSOGgdj33dhihPeuy3l0q23+4e+hoXHV6hCC4dCXw==", "dev": true, "license": "MIT", "peerDependencies": { @@ -1730,8 +1727,6 @@ }, "node_modules/@types/unist": { "version": "3.0.3", - "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.3.tgz", - "integrity": "sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q==", "dev": true, "license": "MIT" }, @@ -1759,8 +1754,6 @@ }, "node_modules/@typescript-eslint/eslint-plugin": { "version": "8.37.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.37.0.tgz", - "integrity": "sha512-jsuVWeIkb6ggzB+wPCsR4e6loj+rM72ohW6IBn2C+5NCvfUVY8s33iFPySSVXqtm5Hu29Ne/9bnA0JmyLmgenA==", "dev": true, "license": "MIT", "dependencies": { @@ -1789,8 +1782,6 @@ }, "node_modules/@typescript-eslint/eslint-plugin/node_modules/ignore": { "version": "7.0.5", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-7.0.5.tgz", - "integrity": "sha512-Hs59xBNfUIunMFgWAbGX5cq6893IbWg4KnrjbYwX3tx0ztorVgTDA6B2sxf8ejHJ4wz8BqGUMYlnzNBer5NvGg==", "dev": true, "license": "MIT", "engines": { @@ -1798,16 +1789,14 @@ } }, "node_modules/@typescript-eslint/parser": { - "version": "8.42.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.42.0.tgz", - "integrity": "sha512-r1XG74QgShUgXph1BYseJ+KZd17bKQib/yF3SR+demvytiRXrwd12Blnz5eYGm8tXaeRdd4x88MlfwldHoudGg==", + "version": "8.37.0", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/scope-manager": "8.42.0", - "@typescript-eslint/types": "8.42.0", - "@typescript-eslint/typescript-estree": "8.42.0", - "@typescript-eslint/visitor-keys": "8.42.0", + "@typescript-eslint/scope-manager": "8.37.0", + "@typescript-eslint/types": "8.37.0", + "@typescript-eslint/typescript-estree": "8.37.0", + "@typescript-eslint/visitor-keys": "8.37.0", "debug": "^4.3.4" }, "engines": { @@ -1819,170 +1808,11 @@ }, "peerDependencies": { "eslint": "^8.57.0 || ^9.0.0", - "typescript": ">=4.8.4 <6.0.0" - } - }, - "node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/project-service": { - "version": "8.42.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.42.0.tgz", - "integrity": "sha512-vfVpLHAhbPjilrabtOSNcUDmBboQNrJUiNAGoImkZKnMjs2TIcWG33s4Ds0wY3/50aZmTMqJa6PiwkwezaAklg==", - "dev": true, - "license": "MIT", - "dependencies": { - "@typescript-eslint/tsconfig-utils": "^8.42.0", - "@typescript-eslint/types": "^8.42.0", - "debug": "^4.3.4" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "typescript": ">=4.8.4 <6.0.0" - } - }, - "node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/scope-manager": { - "version": "8.42.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.42.0.tgz", - "integrity": "sha512-51+x9o78NBAVgQzOPd17DkNTnIzJ8T/O2dmMBLoK9qbY0Gm52XJcdJcCl18ExBMiHo6jPMErUQWUv5RLE51zJw==", - "dev": true, - "license": "MIT", - "dependencies": { - "@typescript-eslint/types": "8.42.0", - "@typescript-eslint/visitor-keys": "8.42.0" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/tsconfig-utils": { - "version": "8.42.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.42.0.tgz", - "integrity": "sha512-kHeFUOdwAJfUmYKjR3CLgZSglGHjbNTi1H8sTYRYV2xX6eNz4RyJ2LIgsDLKf8Yi0/GL1WZAC/DgZBeBft8QAQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "typescript": ">=4.8.4 <6.0.0" - } - }, - "node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/types": { - "version": "8.42.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.42.0.tgz", - "integrity": "sha512-LdtAWMiFmbRLNP7JNeY0SqEtJvGMYSzfiWBSmx+VSZ1CH+1zyl8Mmw1TT39OrtsRvIYShjJWzTDMPWZJCpwBlw==", - "dev": true, - "license": "MIT", - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/typescript-estree": { - "version": "8.42.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.42.0.tgz", - "integrity": "sha512-ku/uYtT4QXY8sl9EDJETD27o3Ewdi72hcXg1ah/kkUgBvAYHLwj2ofswFFNXS+FL5G+AGkxBtvGt8pFBHKlHsQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "@typescript-eslint/project-service": "8.42.0", - "@typescript-eslint/tsconfig-utils": "8.42.0", - "@typescript-eslint/types": "8.42.0", - "@typescript-eslint/visitor-keys": "8.42.0", - "debug": "^4.3.4", - "fast-glob": "^3.3.2", - "is-glob": "^4.0.3", - "minimatch": "^9.0.4", - "semver": "^7.6.0", - "ts-api-utils": "^2.1.0" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "typescript": ">=4.8.4 <6.0.0" - } - }, - "node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/visitor-keys": { - "version": "8.42.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.42.0.tgz", - "integrity": "sha512-3WbiuzoEowaEn8RSnhJBrxSwX8ULYE9CXaPepS2C2W3NSA5NNIvBaslpBSBElPq0UGr0xVJlXFWOAKIkyylydQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "@typescript-eslint/types": "8.42.0", - "eslint-visitor-keys": "^4.2.1" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "node_modules/@typescript-eslint/parser/node_modules/brace-expansion": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.2.tgz", - "integrity": "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "balanced-match": "^1.0.0" - } - }, - "node_modules/@typescript-eslint/parser/node_modules/eslint-visitor-keys": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.1.tgz", - "integrity": "sha512-Uhdk5sfqcee/9H/rCOJikYz67o0a2Tw2hGRPOG2Y1R2dg7brRe1uG0yaNQDHu+TO/uQPF/5eCapvYSmHUjt7JQ==", - "dev": true, - "license": "Apache-2.0", - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" - } - }, - "node_modules/@typescript-eslint/parser/node_modules/minimatch": { - "version": "9.0.5", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", - "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", - "dev": true, - "license": "ISC", - "dependencies": { - "brace-expansion": "^2.0.1" - }, - "engines": { - "node": ">=16 || 14 >=14.17" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" + "typescript": ">=4.8.4 <5.9.0" } }, "node_modules/@typescript-eslint/project-service": { "version": "8.37.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.37.0.tgz", - "integrity": "sha512-BIUXYsbkl5A1aJDdYJCBAo8rCEbAvdquQ8AnLb6z5Lp1u3x5PNgSSx9A/zqYc++Xnr/0DVpls8iQ2cJs/izTXA==", "dev": true, "license": "MIT", "dependencies": { @@ -2003,8 +1833,6 @@ }, "node_modules/@typescript-eslint/scope-manager": { "version": "8.37.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.37.0.tgz", - "integrity": "sha512-0vGq0yiU1gbjKob2q691ybTg9JX6ShiVXAAfm2jGf3q0hdP6/BruaFjL/ManAR/lj05AvYCH+5bbVo0VtzmjOA==", "dev": true, "license": "MIT", "dependencies": { @@ -2021,8 +1849,6 @@ }, "node_modules/@typescript-eslint/tsconfig-utils": { "version": "8.37.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.37.0.tgz", - "integrity": "sha512-1/YHvAVTimMM9mmlPvTec9NP4bobA1RkDbMydxG8omqwJJLEW/Iy2C4adsAESIXU3WGLXFHSZUU+C9EoFWl4Zg==", "dev": true, "license": "MIT", "engines": { @@ -2038,8 +1864,6 @@ }, "node_modules/@typescript-eslint/type-utils": { "version": "8.37.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.37.0.tgz", - "integrity": "sha512-SPkXWIkVZxhgwSwVq9rqj/4VFo7MnWwVaRNznfQDc/xPYHjXnPfLWn+4L6FF1cAz6e7dsqBeMawgl7QjUMj4Ow==", "dev": true, "license": "MIT", "dependencies": { @@ -2063,8 +1887,6 @@ }, "node_modules/@typescript-eslint/types": { "version": "8.37.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.37.0.tgz", - "integrity": "sha512-ax0nv7PUF9NOVPs+lmQ7yIE7IQmAf8LGcXbMvHX5Gm+YJUYNAl340XkGnrimxZ0elXyoQJuN5sbg6C4evKA4SQ==", "dev": true, "license": "MIT", "engines": { @@ -2077,8 +1899,6 @@ }, "node_modules/@typescript-eslint/typescript-estree": { "version": "8.37.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.37.0.tgz", - "integrity": "sha512-zuWDMDuzMRbQOM+bHyU4/slw27bAUEcKSKKs3hcv2aNnc/tvE/h7w60dwVw8vnal2Pub6RT1T7BI8tFZ1fE+yg==", "dev": true, "license": "MIT", "dependencies": { @@ -2106,8 +1926,6 @@ }, "node_modules/@typescript-eslint/typescript-estree/node_modules/brace-expansion": { "version": "2.0.2", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.2.tgz", - "integrity": "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==", "dev": true, "license": "MIT", "dependencies": { @@ -2116,8 +1934,6 @@ }, "node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch": { "version": "9.0.5", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", - "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", "dev": true, "license": "ISC", "dependencies": { @@ -2132,8 +1948,6 @@ }, "node_modules/@typescript-eslint/utils": { "version": "8.37.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.37.0.tgz", - "integrity": "sha512-TSFvkIW6gGjN2p6zbXo20FzCABbyUAuq6tBvNRGsKdsSQ6a7rnV6ADfZ7f4iI3lIiXc4F4WWvtUfDw9CJ9pO5A==", "dev": true, "license": "MIT", "dependencies": { @@ -2156,8 +1970,6 @@ }, "node_modules/@typescript-eslint/visitor-keys": { "version": "8.37.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.37.0.tgz", - "integrity": "sha512-YzfhzcTnZVPiLfP/oeKtDp2evwvHLMe0LOy7oe+hb9KKIumLNohYS9Hgp1ifwpu42YWxhZE8yieggz6JpqO/1w==", "dev": true, "license": "MIT", "dependencies": { @@ -2174,8 +1986,6 @@ }, "node_modules/@typescript-eslint/visitor-keys/node_modules/eslint-visitor-keys": { "version": "4.2.1", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.1.tgz", - "integrity": "sha512-Uhdk5sfqcee/9H/rCOJikYz67o0a2Tw2hGRPOG2Y1R2dg7brRe1uG0yaNQDHu+TO/uQPF/5eCapvYSmHUjt7JQ==", "dev": true, "license": "Apache-2.0", "engines": { @@ -2512,8 +2322,6 @@ }, "node_modules/array-union": { "version": "2.1.0", - "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", - "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", "dev": true, "license": "MIT", "engines": { @@ -3023,6 +2831,15 @@ "dev": true, "license": "ISC" }, + "node_modules/browser-tabs-lock": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/browser-tabs-lock/-/browser-tabs-lock-1.3.0.tgz", + "integrity": "sha512-g6nHaobTiT0eMZ7jh16YpD2kcjAp+PInbiVq3M1x6KKaEIVhT4v9oURNIpZLOZ3LQbQ3XYfNhMAb/9hzNLIWrw==", + "hasInstallScript": true, + "dependencies": { + "lodash": ">=4.17.21" + } + }, "node_modules/browserslist": { "version": "4.24.4", "dev": true, @@ -4339,26 +4156,50 @@ } }, "node_modules/del": { - "version": "6.1.1", - "resolved": "https://registry.npmjs.org/del/-/del-6.1.1.tgz", - "integrity": "sha512-ua8BhapfP0JUJKC/zV9yHHDW/rDoDxP4Zhn3AkA6/xT6gY7jYXJiaeyBZznYVujhZZET+UgcbZiQ7sN3WqcImg==", + "version": "5.1.0", "dev": true, "license": "MIT", "dependencies": { - "globby": "^11.0.1", - "graceful-fs": "^4.2.4", + "globby": "^10.0.1", + "graceful-fs": "^4.2.2", "is-glob": "^4.0.1", "is-path-cwd": "^2.2.0", - "is-path-inside": "^3.0.2", - "p-map": "^4.0.0", - "rimraf": "^3.0.2", + "is-path-inside": "^3.0.1", + "p-map": "^3.0.0", + "rimraf": "^3.0.0", "slash": "^3.0.0" }, "engines": { - "node": ">=10" + "node": ">=8" + } + }, + "node_modules/del/node_modules/globby": { + "version": "10.0.2", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/glob": "^7.1.1", + "array-union": "^2.1.0", + "dir-glob": "^3.0.1", + "fast-glob": "^3.0.3", + "glob": "^7.1.3", + "ignore": "^5.1.1", + "merge2": "^1.2.3", + "slash": "^3.0.0" }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "engines": { + "node": ">=8" + } + }, + "node_modules/del/node_modules/p-map": { + "version": "3.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "aggregate-error": "^3.0.0" + }, + "engines": { + "node": ">=8" } }, "node_modules/delayed-stream": { @@ -4425,8 +4266,6 @@ }, "node_modules/dir-glob": { "version": "3.0.1", - "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", - "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", "dev": true, "license": "MIT", "dependencies": { @@ -4477,6 +4316,14 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/dpop": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/dpop/-/dpop-2.1.1.tgz", + "integrity": "sha512-J0Of2JTiM4h5si0tlbPQ/lkqfZ5wAEVkKYBhkwyyANnPJfWH4VsR5uIkZ+T+OSPIwDYUg1fbd5Mmodd25HjY1w==", + "funding": { + "url": "https://github.com/sponsors/panva" + } + }, "node_modules/dunder-proto": { "version": "1.0.1", "dev": true, @@ -4708,6 +4555,11 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/es-cookie": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/es-cookie/-/es-cookie-1.3.2.tgz", + "integrity": "sha512-UTlYYhXGLOy05P/vKVT2Ui7WtC7NiRzGtJyAKKn32g5Gvcjn7KAClLPWlipCtxIus934dFg9o9jXiBL0nP+t9Q==" + }, "node_modules/es-define-property": { "version": "1.0.1", "dev": true, @@ -5517,16 +5369,12 @@ } }, "node_modules/form-data": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.4.tgz", - "integrity": "sha512-KrGhL9Q4zjj0kiUt5OO4Mr/A/jlI2jDYs5eHBpYHPcBEVSiipAvn2Ko2HnPe20rmcuuvMHNdZFp+4IlGTMF0Ow==", + "version": "4.0.1", "dev": true, "license": "MIT", "dependencies": { "asynckit": "^0.4.0", "combined-stream": "^1.0.8", - "es-set-tostringtag": "^2.1.0", - "hasown": "^2.0.2", "mime-types": "^2.1.12" }, "engines": { @@ -5848,27 +5696,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/globby": { - "version": "11.1.0", - "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", - "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", - "dev": true, - "license": "MIT", - "dependencies": { - "array-union": "^2.1.0", - "dir-glob": "^3.0.1", - "fast-glob": "^3.2.9", - "ignore": "^5.2.0", - "merge2": "^1.4.1", - "slash": "^3.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/gopd": { "version": "1.2.0", "dev": true, @@ -6596,8 +6423,6 @@ }, "node_modules/is-path-cwd": { "version": "2.2.0", - "resolved": "https://registry.npmjs.org/is-path-cwd/-/is-path-cwd-2.2.0.tgz", - "integrity": "sha512-w942bTcih8fdJPJmQHFzkS76NEP8Kzzvmw92cXsazb8intwLqPibPPdXf4ANdKV3rYMuuQYGIWtvz9JilB3NFQ==", "dev": true, "license": "MIT", "engines": { @@ -8123,8 +7948,6 @@ }, "node_modules/koa": { "version": "2.16.1", - "resolved": "https://registry.npmjs.org/koa/-/koa-2.16.1.tgz", - "integrity": "sha512-umfX9d3iuSxTQP4pnzLOz0HKnPg0FaUUIKcye2lOiz3KPu1Y3M3xlz76dISdFPQs37P9eJz1wUpcTS6KDPn9fA==", "dev": true, "license": "MIT", "dependencies": { @@ -8432,8 +8255,6 @@ }, "node_modules/linkify-it": { "version": "5.0.0", - "resolved": "https://registry.npmjs.org/linkify-it/-/linkify-it-5.0.0.tgz", - "integrity": "sha512-5aHCbzQRADcdP+ATqnDuhhJ/MRIqDkZX5pyjFHRRysS8vZ5AbqGEoFIb6pYHPZ+L/OC2Lc+xT8uHVVR5CAK/wQ==", "dev": true, "license": "MIT", "dependencies": { @@ -8524,7 +8345,6 @@ }, "node_modules/lodash": { "version": "4.17.21", - "dev": true, "license": "MIT" }, "node_modules/lodash.defaults": { @@ -8717,8 +8537,6 @@ }, "node_modules/markdown-it": { "version": "14.1.0", - "resolved": "https://registry.npmjs.org/markdown-it/-/markdown-it-14.1.0.tgz", - "integrity": "sha512-a54IwgWPaeBCAAsv13YgmALOF1elABB08FxO9i+r4VFk5Vl4pKokRPeX8u5TCgSsPi6ec1otfLjdOpVcgbpshg==", "dev": true, "license": "MIT", "dependencies": { @@ -8743,8 +8561,6 @@ }, "node_modules/mdurl": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/mdurl/-/mdurl-2.0.0.tgz", - "integrity": "sha512-Lf+9+2r+Tdp5wXDXC4PcIBjTDtq4UKjCPMQhKIuzpJNW0b96kVqSwW0bT7FhRSfmAiFYgP+SCRvdrDozfh0U5w==", "dev": true, "license": "MIT" }, @@ -9211,8 +9027,6 @@ }, "node_modules/oidc-provider": { "version": "8.8.1", - "resolved": "https://registry.npmjs.org/oidc-provider/-/oidc-provider-8.8.1.tgz", - "integrity": "sha512-qVChpayTwojUREJxLkFofUSK8kiSRIdzPrVSsoGibqRHl/YO60ege94OZS8vh7zaK+zxcG/Gu8UMaYB5ulohCQ==", "dev": true, "license": "MIT", "dependencies": { @@ -9522,8 +9336,6 @@ }, "node_modules/path-type": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", - "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", "dev": true, "license": "MIT", "engines": { @@ -9902,8 +9714,6 @@ }, "node_modules/punycode.js": { "version": "2.3.1", - "resolved": "https://registry.npmjs.org/punycode.js/-/punycode.js-2.3.1.tgz", - "integrity": "sha512-uxFIHU0YlHYhDQtV4R9J6a52SLx28BCjT+4ieh7IGbgwVJWO+km431c4yRlREUAsAmt/uMjQUyQHNEPf0M39CA==", "dev": true, "license": "MIT", "engines": { @@ -10034,8 +9844,6 @@ }, "node_modules/react": { "version": "19.1.0", - "resolved": "https://registry.npmjs.org/react/-/react-19.1.0.tgz", - "integrity": "sha512-FS+XFBNvn3GTAWq26joslQgWNoFu08F4kl0J4CgdNKADkdSGXQyTCnKteIAJy96Br6YbpEU1LSzV5dYtjMkMDg==", "dev": true, "license": "MIT", "engines": { @@ -10044,8 +9852,6 @@ }, "node_modules/react-dom": { "version": "19.1.0", - "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-19.1.0.tgz", - "integrity": "sha512-Xs1hdnE+DyKgeHJeJznQmYMIBG3TKIHJJT95Q58nHLSrElKlGQqDTR2HQ9fx5CN/Gk6Vh/kupBTDLU11/nDk/g==", "dev": true, "license": "MIT", "dependencies": { @@ -10419,13 +10225,11 @@ } }, "node_modules/rollup-plugin-delete": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/rollup-plugin-delete/-/rollup-plugin-delete-2.2.0.tgz", - "integrity": "sha512-REKtDKWvjZlbrWpPvM9X/fadCs3E9I9ge27AK8G0e4bXwSLeABAAwtjiI1u3ihqZxk6mJeB2IVeSbH4DtOcw7A==", + "version": "2.1.0", "dev": true, "license": "MIT", "dependencies": { - "del": "^6.1.1" + "del": "^5.1.0" }, "engines": { "node": ">=10" @@ -10670,8 +10474,6 @@ }, "node_modules/scheduler": { "version": "0.26.0", - "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.26.0.tgz", - "integrity": "sha512-NlHwttCI/l5gCPR3D1nNXtWABUmBwvZpEQiD4IXSbIDq8BzLIK/7Ir5gTFSGZDUu37K5cMNp0hFtzO38sC7gWA==", "dev": true, "license": "MIT" }, @@ -10694,8 +10496,6 @@ }, "node_modules/semver": { "version": "7.7.2", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.2.tgz", - "integrity": "sha512-RF0Fw+rO5AMf9MAyaRXI4AV0Ulj5lMHqVxxdSgiVbixSCXoEmmX/jk0CuJw4+3SqroYO9VoUh+HcuJivvtJemA==", "dev": true, "license": "ISC", "bin": { @@ -11511,9 +11311,7 @@ "license": "MIT" }, "node_modules/tmp": { - "version": "0.2.4", - "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.2.4.tgz", - "integrity": "sha512-UdiSoX6ypifLmrfQ/XfiawN6hkjSBpCjhKxxZcWlUUmoXLaCKQU0bx4HF/tdDK2uzRuchf1txGvrWBzYREssoQ==", + "version": "0.2.3", "dev": true, "license": "MIT", "engines": { @@ -11581,8 +11379,6 @@ }, "node_modules/ts-api-utils": { "version": "2.1.0", - "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-2.1.0.tgz", - "integrity": "sha512-CUgTZL1irw8u29bzrOD/nH85jqyc74D6SshFgujOIA7osm2Rz7dYH77agkx7H4FBNxDq7Cjf+IjaX/8zwFW+ZQ==", "dev": true, "license": "MIT", "engines": { @@ -11594,8 +11390,6 @@ }, "node_modules/ts-jest": { "version": "29.4.0", - "resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-29.4.0.tgz", - "integrity": "sha512-d423TJMnJGu80/eSgfQ5w/R+0zFJvdtTxwtF9KzFFunOpSeD+79lHJQIiAhluJoyGRbvj9NZJsl9WjCUo0ND7Q==", "dev": true, "license": "MIT", "dependencies": { @@ -11647,8 +11441,6 @@ }, "node_modules/ts-jest/node_modules/type-fest": { "version": "4.41.0", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-4.41.0.tgz", - "integrity": "sha512-TeTSQ6H5YHvpqVwBRcnLDCBnDOHWYu7IvGbHT6N8AOymcr9PJGjc1GTtiWZTYg0NCgYwvnYWEkVChQAr9bjfwA==", "dev": true, "license": "(MIT OR CC0-1.0)", "engines": { @@ -11817,8 +11609,6 @@ }, "node_modules/typedoc": { "version": "0.28.7", - "resolved": "https://registry.npmjs.org/typedoc/-/typedoc-0.28.7.tgz", - "integrity": "sha512-lpz0Oxl6aidFkmS90VQDQjk/Qf2iw0IUvFqirdONBdj7jPSN9mGXhy66BcGNDxx5ZMyKKiBVAREvPEzT6Uxipw==", "dev": true, "license": "Apache-2.0", "dependencies": { @@ -11863,8 +11653,6 @@ }, "node_modules/typescript": { "version": "5.8.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.8.3.tgz", - "integrity": "sha512-p1diW6TqL9L07nNxvRMM7hMMw4c5XOo/1ibL4aAIGmSAt9slTE1Xgw5KWuof2uTOvCg9BY7ZRi+GaF+7sfgPeQ==", "dev": true, "license": "Apache-2.0", "bin": { @@ -11877,8 +11665,6 @@ }, "node_modules/uc.micro": { "version": "2.1.0", - "resolved": "https://registry.npmjs.org/uc.micro/-/uc.micro-2.1.0.tgz", - "integrity": "sha512-ARDJmphmdvUk6Glw7y9DQ2bFkKBHwQHLi2lsaH6PPmz/Ka9sFOBsBluozhDltWmnv9u/cF6Rt87znRTPV+yp/A==", "dev": true, "license": "MIT" }, @@ -12561,8 +12347,6 @@ }, "node_modules/yaml": { "version": "2.8.0", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.8.0.tgz", - "integrity": "sha512-4lLa/EcQCB0cJkyts+FpIRx5G/llPxfP6VQU5KByHEhLxY3IJCH0f0Hy1MHI8sClTvsIb8qwRJ6R/ZdlDJ/leQ==", "dev": true, "license": "ISC", "bin": { diff --git a/package.json b/package.json index 1484f0f0..1f0b471a 100644 --- a/package.json +++ b/package.json @@ -95,6 +95,6 @@ "react-dom": "^16.11.0 || ^17 || ^18 || ^19" }, "dependencies": { - "@auth0/auth0-spa-js": "^2.2.0" + "@auth0/auth0-spa-js": "^2.4.1" } } diff --git a/src/auth0-context.tsx b/src/auth0-context.tsx index 62d74d1e..8ddd046e 100644 --- a/src/auth0-context.tsx +++ b/src/auth0-context.tsx @@ -9,6 +9,7 @@ import { User, GetTokenSilentlyVerboseResponse, RedirectLoginOptions as SPARedirectLoginOptions, + type Auth0Client, } from '@auth0/auth0-spa-js'; import { createContext } from 'react'; import { AuthState, initialAuthState } from './auth-state'; @@ -140,6 +141,51 @@ export interface Auth0ContextInterface * @param url The URL to that should be used to retrieve the `state` and `code` values. Defaults to `window.location.href` if not given. */ handleRedirectCallback: (url?: string) => Promise; + + /** + * Returns the current DPoP nonce used for making requests to Auth0. + * + * It can return `undefined` because when starting fresh it will not + * be populated until after the first response from the server. + * + * It requires enabling the {@link Auth0ClientOptions.useDpop} option. + * + * @param nonce The nonce value. + * @param id The identifier of a nonce: if absent, it will get the nonce + * used for requests to Auth0. Otherwise, it will be used to + * select a specific non-Auth0 nonce. + */ + getDpopNonce: Auth0Client['getDpopNonce']; + + /** + * Sets the current DPoP nonce used for making requests to Auth0. + * + * It requires enabling the {@link Auth0ClientOptions.useDpop} option. + * + * @param nonce The nonce value. + * @param id The identifier of a nonce: if absent, it will set the nonce + * used for requests to Auth0. Otherwise, it will be used to + * select a specific non-Auth0 nonce. + */ + setDpopNonce: Auth0Client['setDpopNonce']; + + /** + * Returns a string to be used to demonstrate possession of the private + * key used to cryptographically bind access tokens with DPoP. + * + * It requires enabling the {@link Auth0ClientOptions.useDpop} option. + */ + generateDpopProof: Auth0Client['generateDpopProof']; + + /** + * Returns a new `Fetcher` class that will contain a `fetchWithAuth()` method. + * This is a drop-in replacement for the Fetch API's `fetch()` method, but will + * handle certain authentication logic for you, like building the proper auth + * headers or managing DPoP nonces and retries automatically. + * + * Check the `EXAMPLES.md` file for a deeper look into this method. + */ + createFetcher: Auth0Client['createFetcher']; } /** @@ -163,6 +209,10 @@ export const initialContext = { loginWithPopup: stub, logout: stub, handleRedirectCallback: stub, + getDpopNonce: stub, + setDpopNonce: stub, + generateDpopProof: stub, + createFetcher: stub, }; /** diff --git a/src/auth0-provider.tsx b/src/auth0-provider.tsx index 47df9472..c6bcd5aa 100644 --- a/src/auth0-provider.tsx +++ b/src/auth0-provider.tsx @@ -272,6 +272,26 @@ const Auth0Provider = (opts: Auth0ProviderOptions( + (id) => client.getDpopNonce(id), + [client] + ); + + const setDpopNonce = useCallback( + (nonce, id) => client.setDpopNonce(nonce, id), + [client] + ); + + const generateDpopProof = useCallback( + (params) => client.generateDpopProof(params), + [client] + ); + + const createFetcher = useCallback( + (config) => client.createFetcher(config), + [client] + ); + const contextValue = useMemo>(() => { return { ...state, @@ -282,6 +302,10 @@ const Auth0Provider = (opts: Auth0ProviderOptions(opts: Auth0ProviderOptions{children}; diff --git a/src/index.tsx b/src/index.tsx index 3b860ff1..94efde79 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -36,6 +36,8 @@ export { PopupTimeoutError, AuthenticationError, MissingRefreshTokenError, - GenericError + GenericError, + UseDpopNonceError, + type FetcherConfig } from '@auth0/auth0-spa-js'; export { OAuthError } from './errors'; From 443d0fddcf1df03b348c128d67e81d5959d794ae Mon Sep 17 00:00:00 2001 From: Gyanesh Gouraw <160731216+gyaneshgouraw-okta@users.noreply.github.com> Date: Wed, 17 Sep 2025 18:02:38 +0530 Subject: [PATCH 8/8] Release v2.5.0 (#895) **Added** - Add support for DPoP [\#869](https://github.com/auth0/auth0-react/pull/869) ([martinml](https://github.com/martinml)) --- .version | 2 +- CHANGELOG.md | 6 ++ docs/assets/hierarchy.js | 2 +- docs/assets/navigation.js | 2 +- docs/assets/search.js | 2 +- docs/classes/AuthenticationError.html | 2 +- docs/classes/GenericError.html | 2 +- docs/classes/MfaRequiredError.html | 2 +- docs/classes/MissingRefreshTokenError.html | 2 +- docs/classes/OAuthError.html | 4 +- docs/classes/PopupCancelledError.html | 2 +- docs/classes/PopupTimeoutError.html | 2 +- docs/classes/TimeoutError.html | 2 +- docs/classes/UseDpopNonceError.html | 16 +++++ docs/classes/User.html | 4 +- docs/functions/Auth0Provider.html | 2 +- docs/functions/useAuth0.html | 2 +- docs/functions/withAuth0.html | 2 +- .../functions/withAuthenticationRequired.html | 2 +- docs/hierarchy.html | 2 +- docs/interfaces/Auth0ContextInterface.html | 65 ++++++++++++++++--- docs/interfaces/Auth0ProviderOptions.html | 53 ++++++++------- docs/interfaces/AuthorizationParams.html | 30 ++++----- docs/interfaces/GetTokenSilentlyOptions.html | 10 +-- docs/interfaces/GetTokenWithPopupOptions.html | 6 +- docs/interfaces/ICache.html | 4 +- docs/interfaces/IdToken.html | 4 +- docs/interfaces/LogoutOptions.html | 8 +-- docs/interfaces/LogoutUrlOptions.html | 6 +- docs/interfaces/PopupConfigOptions.html | 6 +- docs/interfaces/PopupLoginOptions.html | 4 +- docs/interfaces/RedirectLoginOptions.html | 10 +-- docs/interfaces/WithAuth0Props.html | 4 +- .../WithAuthenticationRequiredOptions.html | 12 ++-- docs/modules.html | 2 +- docs/types/AppState.html | 4 +- docs/types/CacheLocation.html | 2 +- docs/types/Cacheable.html | 2 +- docs/types/FetcherConfig.html | 5 ++ docs/variables/Auth0Context.html | 2 +- package-lock.json | 4 +- package.json | 2 +- 42 files changed, 193 insertions(+), 114 deletions(-) create mode 100644 docs/classes/UseDpopNonceError.html create mode 100644 docs/types/FetcherConfig.html diff --git a/.version b/.version index fa49670c..d80b4a81 100644 --- a/.version +++ b/.version @@ -1 +1 @@ -v2.4.0 \ No newline at end of file +v2.5.0 \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 90c5bd11..ed7ba15f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Change Log +## [v2.5.0](https://github.com/auth0/auth0-react/tree/v2.5.0) (2025-09-17) +[Full Changelog](https://github.com/auth0/auth0-react/compare/v2.4.0...v2.5.0) + +**Added** +- Add support for DPoP [\#869](https://github.com/auth0/auth0-react/pull/869) ([martinml](https://github.com/martinml)) + ## [v2.4.0](https://github.com/auth0/auth0-react/tree/v2.4.0) (2025-07-22) [Full Changelog](https://github.com/auth0/auth0-react/compare/v2.3.0...v2.4.0) diff --git a/docs/assets/hierarchy.js b/docs/assets/hierarchy.js index 2bfc7f55..5a7312df 100644 --- a/docs/assets/hierarchy.js +++ b/docs/assets/hierarchy.js @@ -1 +1 @@ -window.hierarchyData = "eJyVlF1rgzAUhv/LuU5XjekavRtljEHHRlfYRelFiMcaapMuiVfF/z60bNivmV4J+hyf9+QcPYA1xjvIVoxTQnlCYp6uCVgsKpReGe0gO0DM0/aixQ4hgw+zr/dzs1H6fX9ECGyVziGjk0cCta0gA6U92kJIdOML/qH0uwoIyEo4Bxl4l4/aF4z+itqHpapyixqyVZyydUMgTlkvxQv6pdmi/lK+7AxhYW6VBWRqCFCe9CK8zoQscUB4hO5tOYlo23IS0Z5vbqSoPr2xYoOn6pjyX3VnQDe+gG9GON5obTTq2ZZqh6b2z9Ya+5+ozw04TltMedci60/1rRAL/K6VxXxQfM4GNDil53s8E1piVQXoruABxpSfG0PP9QIetjHaP8un2peovZKi3fBB3xU8wDg5mZ5yTunNAguLruy+s+Ep3qgJcHN68j/QaJUc9PW5u9aVRiRhjCRTShhlhE3YummaH8/hv8o=" \ No newline at end of file +window.hierarchyData = "eJyVlMtOwzAQRf9l1oYmsR252SFACImXCogFYmG508YitYPtrKr+O0oqkPvCYRUpOZMz1zPJGpy1wUP1znNBaD4lRcE/CDhcNKiCtsZDtYai4P3FyBVCBU+27do7u9Tmsd0iBD61mUNV8JJA5xqoQJuAbiEV+skBf16HVQMEVCO9hwqCn5/1Lzj7Leof1rqZOzRQvRc0+9gQKGgWdXGD4cV+onnToR4M45o5VTaipw0Bmk+jFm4vpaoxIdxC/41MqegjUyoi351VsnkO1skl7qrzQvyoBwP6yQF8soXtjd7Gy8j2oldou3DtnHV/iWIu4diJyCgbIop4qvcLOcOvTjucJ8X7bDogy8T+Hl9Ko7BpRuiO4COMlO0bx57rATzCVsZnedGFGk3QSvYbnvQdwUcYpzvT095rs5zhwqGvh+8sPcUTNWk3z8XO/8Cg0yrpi7n/rCvlJaEiIywThJUZYdOMcDasMGfxkF89XrW2fbBGYbKbAzgVe7P5Bo2A5S4=" \ No newline at end of file diff --git a/docs/assets/navigation.js b/docs/assets/navigation.js index c8a14767..f25d8eec 100644 --- a/docs/assets/navigation.js +++ b/docs/assets/navigation.js @@ -1 +1 @@ -window.navigationData = "eJylll1v0zAUhv+Lr7uxdWxA71CFUKVOq9pNXCAuTHLSWHPtYJ+MFcR/R06W5sMfidzL5rx+Hje2j/P9L0F4RbIgn0vMQSBLKDIpviglFZmRgmJOFiThVGvQ7xyhyxwPnMzIMxMpWVzPP87qNFkQ1OkF0xfwiqAE5eTf7GT7CgIUSzyabjWOvxL3cJDquKRJDragV44zrGVC+Q6lonvwWKxInOk+o1v4VTIFqed9DRORHqY1E/stZAp0/iifwbcNfMk474PZVR5TW7PYHcJGFmWxpCIBzr0vyRGKm28FemQHkCWGXN1InCksOZ//pMHBNU/jeGaxrpZSmJ8rgaAymnTOBWse1Y3ESval89u7IXqj5AtLQT0Upv1oP3kQHANLxf5UHW1DFT34uYOchZ3Y+rA6MTvGQSA/hv6MJ3ue+BvDvNqgU8zDcJx6NeiQHdHK0RknY9Nqjm5uXYsDr+Velhh6P71EaH/VwSfFx2ltKG7WdYeTImP7kMyOnaFbyz0To7ZuKk62hZQpSHDU5wqG1sds8KZnFG5kPzIF1n4jNfdyaMqjo4L9qyh2SLFzuPBYmH719nww9urTh+vbeWd8dfzoT24BTgUnYdKiVQjzFWT+hZPfFOMd3ZukVbxQxczc+zdN33Iz990vLScrRVItQf9e6YPu3ndApYYq6mI0tcDw381ec40/FScA7M0UItppS/HjP4K3Nns=" \ No newline at end of file +window.navigationData = "eJylll1v0zAUhv+LrzvYChvQO1Q+VKljVbuJC8SFcU4Sa64d7JOxgvjvKAlpk/gjkXvZntfP4zj2cb79IQjPSBbkfYk5SOSMIlfyo9ZKkxkpKOZkQZigxoB56Qi9yHEvyIw8cpmQxdX87axJkwVBk1xwcwHPCFpSQf7OjrbPIEFz5tF0q3H8lbyFvdKHJWU52IJeOc6wVoyKHSpNM/BYrEic6TalW/hZcg2JZ72GiUgPN4bLbAupBpPfq0fwbQNfMs57V+0qj+lUs9gdwkYVZbGkkoEQ3kVyhOLmW4Pu+R5UiSFXNxJnCkvO5z8Y+FCo4ouSDDwSKxJtcsMjedW2uFwqWf1cSQSdUtY5gbz9q2lZVrIvnV/fDNEbrZ54AvquqBqd8ZMHwTGw0vx33Ts3VNO9nzvIWdiJTRbrs7njAiSKQ+hhPNnzxF855vVRmGIehuPUq0Ev7ohWjh48GZvUc3Rzm1oceK0yVWJofXqJ0P5qgg9ajNNOobhZN71UyZRnIZkdO0O3VhmXo7ZuKk62hYRrYDjqcwVD76fa4G3PKNzIfmQK7PQ11n4BhKY8OirYv4pihxQ7hwsPRdWv/v8/GHv57s3V9bwzvj5+9IewAMeCkzDppdWI6nuregonvy3GOz4Bshx0s5+Hjl4x3tG9rU6KJ6p5tT7926xveTX33WEnTlpKVr/m/t3VB9287oBKA3XUxWhrgeG/2v3sGn8sTgDYGzZEtNOW4vs/Ayx8aw==" \ No newline at end of file diff --git a/docs/assets/search.js b/docs/assets/search.js index 58631ebd..a27fcf73 100644 --- a/docs/assets/search.js +++ b/docs/assets/search.js @@ -1 +1 @@ -window.searchData = "eJy1mU1v2zgQhv8Lc1VTz9Dft7bYQ4ECLbbF7sEIClViYiKKpJXktEWQ/76gZElDceRQsXszLM7Ll+QzQ0p8EkX2sxTb3ZO412kstoDrQKThgxJb8fndodr/VRRZIQJxKBKxFVESlqUq3/aPrvfVQyKC9onYCvEctGoLwE4tytKyKg5R9bLcld2WSAciDwuVVra7vkOY4bzrUflYv2pbndXL91iVUaHzSmepX4+DiAm942LZdW6ezz5kaaV+VR/TShW3YaQ6A7r9p3zLNjy5diem0kuXmdiqjN/o8o1O96rQlYrpUPmRjNi5U9W7KFJl+S27V+lXnai0Sn5P9HenqrAWqYxI2Yvwa3GGwX91tf+S5Yf8LIc/dbXPjyqXsfgxru19SEL9UE73puPaV9SGX8DUPkzjRP2tYl2oqPoQJsmPMLqfaK0RKY4iUS9yAYO6NM1VWukobAie4kyX4SD6DySHLj9lYazTu8nmki7uD9hKsjv96kyogy+cAJ2hFrfXeir6+MvYyg6v8NIEXcDAoVRTS/0x5DLUOPvblyJ71LEqPteb5XihGrTz392ivU7iQqWTlK9I1IlZH5ofs9DMx0QHXdD5BrLUu+qyXrJ0WsH1tFXe6/w8Y0bhUtYomp/qlDvBpNXgJIxUth3sJ1NdTqhz7bw7MVWvHWrOytst/FPJ7G8zT8GrtjG/FgOTp0dy3FO1wfi/gy5UfGLuXgyaUDrG89avlxeT+OURntrfzp6FZpvLOpkLm8zS9+o2K5QdfIbdLP1RC4ZDwYsbbzNw5KTl7bewdC5ss1DVoUi/ZWc4bCSq7CLmcLZZwaL/KvAuz79WYdW/s1a/c1POj3/7J6IzUEbo5aF0dvpeJLJv210/j2Ghwx/J4IB00vhyzh9wOs3bQxrVM2fva76ih7LOpxmj1z7ylfrZFmFGq3s2VcwF5YS625jr7iYQOo3VL7F9Eo+qKE3ObwVey+uNCMStVklsPnM1TgIRZQ8PZsUDEWfRof55c2z2jzKfnUzjpvXbmQh2s0Di9WINNzfBrg2uH9R/tBr9P3UgiGAHXCA4gWAFogh2GODqer6SViA6gWgFShHsJNejdAKlFTgXwW7OBc6dwLkVuBizunACF1bgUgS7Bdfj0glcWoErEeyWXODKCVxZgWsR7FZc4NoJXFuBGxHs1lzgxgnc2AAYHjYsAS47MICnpoflDhh+bIDAYAE8ey5DYEMEBg1ANtjlCGyQwOABLIPgsgQ2TGAQAZZDcHkCGygwmACLFLhMgQ0VGFSAxQpcrsAGCwwusOKyAFy2wIYLDDLA4gUuX2ADhoYZYAlDlzC0CUPDDLKEoUsYDkpUXaNYwpCpUjZhaJhBljB0CUObMDTMIEsYuoShTRjW9YolDF3C0CYMl6PrjC5haBOGhhlk8USXMLQJQ8MMsniiSxjahKFhBtnKhy5haBMmDTO45sYsXcKkTZisCWPxlC5h0iZM4njPLmFysBHWOyHLtmT2QpswaZiRLNvSJUzahEnDjGTZli5h0iZMGmYkv4O7hEmbMGmYkSzb0iXs+Fd9bnpURaXij835abcTYZ6XzaH8SXw/Hqtw0x7jnoQEsX16fu6PUdunZ3KSMs9MX8fXe6Ihew2c+2t0r8i9lJwRO3KyVPcWRDXnveQEc3l3eCfugLh7hVb3ut1LwqKXhKWXZP+BksgsiczKT4ZexhIlIuSrM1xFWBGRdROHfoM73i4SuAhbTczCX8i+jSULSdbRS23sUrGXJOvoN9LRW8Bekyyq35q6t3e9GFmTtZfY2H1bL7nuJTdeks5FWa9F6hDMPMW6iy2CHikg4Aew/SWMkEeWFP3mf3ifRXzRvMJpYv1FFNEjeQF+DLeXSUSE5AH41bNGhJstMvHoN/FZDcMw4YmOHwdjnwaJN5JI6Ac/d+9BJo6QD37oDz4IEnMkMdFPq1UaJZfAhn6w9Z/QiAwZpZw1gdJPjr+dIRNI0h39lvlQKufkIUkWSL99obnTJE7I8QD8JExOulbonuK3A3Q6eXNdQ2ae7np+2d2K9RlQdB/hiEsyWulX08aFOfKIPnrM5k0gcp2rRKdKbHc3z8//Ay+N4VU="; \ No newline at end of file +window.searchData = "eJy1ml1vnDgUhv+Lc0vT8THzedfN7kqVqm21rXYvRlFFwclYIcAaJm01yn9fGQY4xmcmJkPvIvB5/do859hj58B0/r1km+2BPagsYRsOq4Bl0aNkG/bx3b7a/aF1rlnA9jplGxanUVnK8m3/6npXPaYsaN+wDWPPQas259CpxXlWVnofVy/LXdltkXTAikjLrLLd9R3yGYRdj9LH+lXb6qJeviayjLUqKpVnfj0OIkb0DvNF17l5P7vJs0r+qN5nldR3USw7A6p9Ur4lG579dtYgYy2jSv4pq3gn9Tj9qyb2roulh0qPxOvL+tlwv3NVJm9U+UZlO6lVJZNX27mXmdRRJX8v8uKTzvO7kdba+KTIi+IYP8Es3cvqXRzLsvySP8jss0plVqU/R3urolqkMiJlLzK5wX9VtfuUF/viIoffVbUrjirTWDRf9a88G5tXxpf5oNkxdBoz75N6rm7SSD2W4w2ppJ6kuA2fwNQuypJU/i0TpWVc3URp+i2KH0Zaa0T0USTuRSYwqErTXGaViqMmy8c4U2U0iP4FBUSVH/IoUdn9aHNpF/cLbKX5vXp1WtbBE2djZ6jF7bWedB8/ja18/wovTdAEBsrXV6ly8iq1L0dvEY4h0yDs7I8+6fxJJVJ/rDdbp6vmoN2I3dFOpYmW2SjlKxR1ZtaH5k9ZaOZjpIMu6HIDeea9BJBe8mxc9fe0VT6o4jJjRmEqaxjND3X+n2HSanAWRizbDvaDKXVn1Kl23p2YEtwOtSDl7Rb+qWQW25mn4FXbmP4WA5PnR3Jc4JXB+L+90jI5M3cvBo0oHafz1q+XF5P45RGeW2wvnoVmzc07mYlN5tlv8i7X0g6+wG6efasFo6Hg5MbbDDyx7fP2qy2diW1qWe119iW/wGEjUeWTmIPZesnn/anSu6L4XEVVv+upfhamnB8f+yeiM1BC6OWhdHb6XgTYu5GbQcY/RVpF39LBBums8UVIb3A6zbt9FtczZ69rvqL7ss6nGaHXvvKV+t4WYUKrezdWzAXljLrbmOruNmAqS+QPtjmwJ6lLk/MbBtfies0Cdqdkmphj0sZJwOL88dF88YAlebyv/7w9NvtHmmNL07hp/XbGgu0sEOJ6Pl/e3gbbNrh+UT9oNfondSBnwZZTgdwJ5FYgsGALAayuw3BtBYITCFagYMFWUD0KJ1BYgSELtiEVGDqBoRU4Z8F2TgXOncC5Fbg4NcaFE7iwApcs2C6oHpdO4NIKXLFgu6QCV07gygpcs2C7ogLXTuDaBsDwsCYJcNnhA3hqekjuOMGPDRA3WHCaPZchbkPEDRocyGCXI26DxA0enGSQuyxxGyZuEOEkh9zlidtAcYMJJ1nkLlPchoobVDiJFXe54jZY3ODCSbS4yxa34eIGGU7ixV2+uA0YGGY4SRi4hIFNGBhmgCQMXMJgUKLqGsXJIkVUKZswMMwASRi4hIFNGBhmgCQMXMLAJgwMM0ASBi5hYBMGdc0iCQOXMLAJA8MMkISBSxjYhIFhBkjCwCUMbMLAMAMkYeASBjZhYnbyOwuXMGETJmrCSDyFS5iwCROGGUHiKVzCxGAhrFdCsgAKYi20CROGGUEuTsIlTNiECcOMoBdhlzBhEyYWp3t2CRM2YcIwI0i2hUuYsAkThhlBsi1cwoRNmDDMCJJt4RImbMJCw4wg2Q5dwkKbsNAwI0i2Q5ew46N6r/gkdSWT982ecbtlUVGUzQ+RA/t63EoK0W5dD0zM2ebw/NxvHTeHZ7R7NO9MX8cjjV4Dlr0GrPw1umMBZCdEdpajpbpfflgTSYb+ikX3gwW5myN3IwbaanVHDL0kX6O5m3lJ9oey6BPMkAz3k8H/wIAM9ULeOsOvCEgEoIkTnoOzb+J7TTT1fpgeL9ORK2SqiVn4C9n/C4GQQER4qREX6b3aolfzg//U1XcviXLTj9iTd9W95qrXXPtqohucXgjBz/34cC+IEbooCbgfvKcudZEoTgjwEnXuY5EagpD7AYMuUJEO4o77VTX7kBOlBfoIwm/WhvemyBcqttwvT4kLT6SH0p77pWt7aYlEUFpxv7xqRKjZQgMEvwHmNQ3DaoRY9SP/1KkvqkVIU/ihSl1pocHikulH6+CsF5lDeST8tFqlk+QiOMAPjv50FDlDoxThcbXykytP1DWOqi73K7v0HR4aLMp48Mv4fSmdvZpAuSD8indz840Gh8o/95Mw6e1aQZMU+uVAp1M0l3poetC4wC/HW7E+mXR3VItcotGGfuXxtDAFMdIHj9m8DVihCpmqTLLN9vb5+X+5lFjk"; \ No newline at end of file diff --git a/docs/classes/AuthenticationError.html b/docs/classes/AuthenticationError.html index 5aa0e4ad..564dcefb 100644 --- a/docs/classes/AuthenticationError.html +++ b/docs/classes/AuthenticationError.html @@ -1,6 +1,6 @@ AuthenticationError | @auth0/auth0-react
@auth0/auth0-react
    Preparing search index...

    Class AuthenticationError

    Thrown when handling the redirect callback fails, will be one of Auth0's Authentication API's Standard Error Responses: https://auth0.com/docs/api/authentication?javascript#standard-error-responses

    -

    Hierarchy (View Summary)

    Index

    Constructors

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    appState error error_description diff --git a/docs/classes/GenericError.html b/docs/classes/GenericError.html index e1fdb9b6..a2f33d03 100644 --- a/docs/classes/GenericError.html +++ b/docs/classes/GenericError.html @@ -1,5 +1,5 @@ GenericError | @auth0/auth0-react
    @auth0/auth0-react
      Preparing search index...

      Class GenericError

      Thrown when network requests to the Auth server fail.

      -

      Hierarchy (View Summary)

      Index

      Constructors

      Hierarchy (View Summary)

      Index

      Constructors

      Properties

      error error_description message diff --git a/docs/classes/MfaRequiredError.html b/docs/classes/MfaRequiredError.html index bab9b0d6..dcdd75cb 100644 --- a/docs/classes/MfaRequiredError.html +++ b/docs/classes/MfaRequiredError.html @@ -1,5 +1,5 @@ MfaRequiredError | @auth0/auth0-react
      @auth0/auth0-react
        Preparing search index...

        Class MfaRequiredError

        Error thrown when the token exchange results in a mfa_required error

        -

        Hierarchy (View Summary)

        Index

        Constructors

        Hierarchy (View Summary)

        Index

        Constructors

        Properties

        error error_description message diff --git a/docs/classes/MissingRefreshTokenError.html b/docs/classes/MissingRefreshTokenError.html index bb8f48de..47599247 100644 --- a/docs/classes/MissingRefreshTokenError.html +++ b/docs/classes/MissingRefreshTokenError.html @@ -1,5 +1,5 @@ MissingRefreshTokenError | @auth0/auth0-react
        @auth0/auth0-react
          Preparing search index...

          Class MissingRefreshTokenError

          Error thrown when there is no refresh token to use

          -

          Hierarchy (View Summary)

          Index

          Constructors

          Hierarchy (View Summary)

          Index

          Constructors

          Properties

          audience error error_description diff --git a/docs/classes/OAuthError.html b/docs/classes/OAuthError.html index fe1a0248..9e31978a 100644 --- a/docs/classes/OAuthError.html +++ b/docs/classes/OAuthError.html @@ -1,7 +1,7 @@ OAuthError | @auth0/auth0-react
          @auth0/auth0-react
            Preparing search index...

            Class OAuthError

            An OAuth2 error will come from the authorization server and will have at least an error property which will be the error code. And possibly an error_description property

            See: https://openid.net/specs/openid-connect-core-1_0.html#rfc.section.3.1.2.6

            -

            Hierarchy

            • Error
              • OAuthError
            Index

            Constructors

            Hierarchy

            • Error
              • OAuthError
            Index

            Constructors

            • Parameters

              • error: string
              • Optionalerror_description: string

              Returns OAuthError

            Properties

            error: string
            error_description?: string
            message: string
            name: string
            stack?: string
            prepareStackTrace?: (err: Error, stackTraces: CallSite[]) => any

            Optional override for formatting stack traces

            +

            Constructors

            • Parameters

              • error: string
              • Optionalerror_description: string

              Returns OAuthError

            Properties

            error: string
            error_description?: string
            message: string
            name: string
            stack?: string
            prepareStackTrace?: (err: Error, stackTraces: CallSite[]) => any

            Optional override for formatting stack traces

            stackTraceLimit: number

            Methods

            • Create .stack property on a target object

              Parameters

              • targetObject: object
              • OptionalconstructorOpt: Function

              Returns void

            diff --git a/docs/classes/PopupCancelledError.html b/docs/classes/PopupCancelledError.html index b5d17409..a6df7f89 100644 --- a/docs/classes/PopupCancelledError.html +++ b/docs/classes/PopupCancelledError.html @@ -1,5 +1,5 @@ PopupCancelledError | @auth0/auth0-react
            @auth0/auth0-react
              Preparing search index...

              Class PopupCancelledError

              Thrown when network requests to the Auth server fail.

              -

              Hierarchy (View Summary)

              Index

              Constructors

              Hierarchy (View Summary)

              Index

              Constructors

              Properties

              error error_description message diff --git a/docs/classes/PopupTimeoutError.html b/docs/classes/PopupTimeoutError.html index cd230784..fb5a68eb 100644 --- a/docs/classes/PopupTimeoutError.html +++ b/docs/classes/PopupTimeoutError.html @@ -1,5 +1,5 @@ PopupTimeoutError | @auth0/auth0-react
              @auth0/auth0-react
                Preparing search index...

                Class PopupTimeoutError

                Error thrown when the login popup times out (if the user does not complete auth)

                -

                Hierarchy (View Summary)

                Index

                Constructors

                Hierarchy (View Summary)

                Index

                Constructors

                Properties

                error error_description message diff --git a/docs/classes/TimeoutError.html b/docs/classes/TimeoutError.html index 2845fa31..39ba0ae0 100644 --- a/docs/classes/TimeoutError.html +++ b/docs/classes/TimeoutError.html @@ -1,6 +1,6 @@ TimeoutError | @auth0/auth0-react
                @auth0/auth0-react
                  Preparing search index...

                  Class TimeoutError

                  Thrown when silent auth times out (usually due to a configuration issue) or when network requests to the Auth server timeout.

                  -

                  Hierarchy (View Summary)

                  Index

                  Constructors

                  Hierarchy (View Summary)

                  Index

                  Constructors

                  Properties

                  error error_description message diff --git a/docs/classes/UseDpopNonceError.html b/docs/classes/UseDpopNonceError.html new file mode 100644 index 00000000..f61f0552 --- /dev/null +++ b/docs/classes/UseDpopNonceError.html @@ -0,0 +1,16 @@ +UseDpopNonceError | @auth0/auth0-react
                  @auth0/auth0-react
                    Preparing search index...

                    Class UseDpopNonceError

                    Error thrown when the wrong DPoP nonce is used and a potential subsequent retry wasn't able to fix it.

                    +

                    Hierarchy (View Summary)

                    Index

                    Constructors

                    Properties

                    error: string
                    error_description: string
                    message: string
                    name: string
                    newDpopNonce: undefined | string
                    stack?: string
                    prepareStackTrace?: (err: Error, stackTraces: CallSite[]) => any

                    Optional override for formatting stack traces

                    +
                    stackTraceLimit: number

                    Methods

                    • Create .stack property on a target object

                      +

                      Parameters

                      • targetObject: object
                      • OptionalconstructorOpt: Function

                      Returns void

                    • Parameters

                      • __namedParameters: { error: string; error_description: string }

                      Returns GenericError

                    diff --git a/docs/classes/User.html b/docs/classes/User.html index 16662013..d988f522 100644 --- a/docs/classes/User.html +++ b/docs/classes/User.html @@ -1,4 +1,4 @@ -User | @auth0/auth0-react
                    @auth0/auth0-react
                      Preparing search index...

                      Class User

                      Indexable

                      • [key: string]: any
                      Index

                      Constructors

                      constructor +User | @auth0/auth0-react
                      @auth0/auth0-react
                        Preparing search index...

                        Class User

                        Indexable

                        • [key: string]: any
                        Index

                        Constructors

                        Properties

                        Constructors

                        Properties

                        address?: string
                        birthdate?: string
                        email?: string
                        email_verified?: boolean
                        family_name?: string
                        gender?: string
                        given_name?: string
                        locale?: string
                        middle_name?: string
                        name?: string
                        nickname?: string
                        phone_number?: string
                        phone_number_verified?: boolean
                        picture?: string
                        preferred_username?: string
                        profile?: string
                        sub?: string
                        updated_at?: string
                        website?: string
                        zoneinfo?: string
                        +

                        Constructors

                        Properties

                        address?: string
                        birthdate?: string
                        email?: string
                        email_verified?: boolean
                        family_name?: string
                        gender?: string
                        given_name?: string
                        locale?: string
                        middle_name?: string
                        name?: string
                        nickname?: string
                        phone_number?: string
                        phone_number_verified?: boolean
                        picture?: string
                        preferred_username?: string
                        profile?: string
                        sub?: string
                        updated_at?: string
                        website?: string
                        zoneinfo?: string
                        diff --git a/docs/functions/Auth0Provider.html b/docs/functions/Auth0Provider.html index 5a8a8a51..2fe95db0 100644 --- a/docs/functions/Auth0Provider.html +++ b/docs/functions/Auth0Provider.html @@ -2,4 +2,4 @@

                        Provides the Auth0Context to its child components.

                        -

                        Type Parameters

                        Parameters

                        Returns Element

                        +

                        Type Parameters

                        Parameters

                        Returns Element

                        diff --git a/docs/functions/useAuth0.html b/docs/functions/useAuth0.html index aab84b23..191855f9 100644 --- a/docs/functions/useAuth0.html +++ b/docs/functions/useAuth0.html @@ -3,4 +3,4 @@

                        Use the useAuth0 hook in your components to access the auth state and methods.

                        TUser is an optional type param to provide a type to the user field.

                        -

                        Type Parameters

                        Parameters

                        Returns Auth0ContextInterface<TUser>

                        +

                        Type Parameters

                        Parameters

                        Returns Auth0ContextInterface<TUser>

                        diff --git a/docs/functions/withAuth0.html b/docs/functions/withAuth0.html index 9a94a284..16cabf62 100644 --- a/docs/functions/withAuth0.html +++ b/docs/functions/withAuth0.html @@ -4,4 +4,4 @@

                        Wrap your class components in this Higher Order Component to give them access to the Auth0Context.

                        Providing a context as the second argument allows you to configure the Auth0Provider the Auth0Context should come from f you have multiple within your application.

                        -

                        Type Parameters

                        Parameters

                        Returns ComponentType<Omit<P, "auth0">>

                        +

                        Type Parameters

                        Parameters

                        Returns ComponentType<Omit<P, "auth0">>

                        diff --git a/docs/functions/withAuthenticationRequired.html b/docs/functions/withAuthenticationRequired.html index 87ffb39f..885c8f90 100644 --- a/docs/functions/withAuthenticationRequired.html +++ b/docs/functions/withAuthenticationRequired.html @@ -3,4 +3,4 @@

                        When you wrap your components in this Higher Order Component and an anonymous user visits your component they will be redirected to the login page; after login they will be returned to the page they were redirected from.

                        -

                        Type Parameters

                        • P extends object

                        Parameters

                        Returns FC<P>

                        +

                        Type Parameters

                        • P extends object

                        Parameters

                        Returns FC<P>

                        diff --git a/docs/hierarchy.html b/docs/hierarchy.html index f1d10527..b622c523 100644 --- a/docs/hierarchy.html +++ b/docs/hierarchy.html @@ -1 +1 @@ -@auth0/auth0-react
                        @auth0/auth0-react
                          Preparing search index...
                          +@auth0/auth0-react
                          @auth0/auth0-react
                            Preparing search index...
                            diff --git a/docs/interfaces/Auth0ContextInterface.html b/docs/interfaces/Auth0ContextInterface.html index 8e81cbba..a9547c79 100644 --- a/docs/interfaces/Auth0ContextInterface.html +++ b/docs/interfaces/Auth0ContextInterface.html @@ -1,7 +1,10 @@ Auth0ContextInterface | @auth0/auth0-react
                            @auth0/auth0-react
                              Preparing search index...

                              Interface Auth0ContextInterface<TUser>

                              Contains the authenticated state and authentication methods provided by the useAuth0 hook.

                              -
                              interface Auth0ContextInterface<TUser extends User = User> {
                                  error: undefined | Error;
                                  getAccessTokenSilently: {
                                      (
                                          options: GetTokenSilentlyOptions & { detailedResponse: true },
                                      ): Promise<GetTokenSilentlyVerboseResponse>;
                                      (options?: GetTokenSilentlyOptions): Promise<string>;
                                      (
                                          options: GetTokenSilentlyOptions,
                                      ): Promise<string | GetTokenSilentlyVerboseResponse>;
                                  };
                                  getAccessTokenWithPopup: (
                                      options?: GetTokenWithPopupOptions,
                                      config?: PopupConfigOptions,
                                  ) => Promise<undefined | string>;
                                  getIdTokenClaims: () => Promise<undefined | IdToken>;
                                  handleRedirectCallback: (url?: string) => Promise<RedirectLoginResult<any>>;
                                  isAuthenticated: boolean;
                                  isLoading: boolean;
                                  loginWithPopup: (
                                      options?: PopupLoginOptions,
                                      config?: PopupConfigOptions,
                                  ) => Promise<void>;
                                  loginWithRedirect: (
                                      options?: RedirectLoginOptions<AppState>,
                                  ) => Promise<void>;
                                  logout: (options?: LogoutOptions) => Promise<void>;
                                  user: undefined | TUser;
                              }

                              Type Parameters

                              Hierarchy

                              • AuthState<TUser>
                                • Auth0ContextInterface
                              Index

                              Properties

                              interface Auth0ContextInterface<TUser extends User = User> {
                                  createFetcher: <TOutput extends CustomFetchMinimalOutput = Response>(
                                      config?: FetcherConfig<TOutput>,
                                  ) => Fetcher<TOutput>;
                                  error: undefined | Error;
                                  generateDpopProof: (
                                      params: {
                                          accessToken: string;
                                          method: string;
                                          nonce?: string;
                                          url: string;
                                      },
                                  ) => Promise<string>;
                                  getAccessTokenSilently: {
                                      (
                                          options: GetTokenSilentlyOptions & { detailedResponse: true },
                                      ): Promise<GetTokenSilentlyVerboseResponse>;
                                      (options?: GetTokenSilentlyOptions): Promise<string>;
                                      (
                                          options: GetTokenSilentlyOptions,
                                      ): Promise<string | GetTokenSilentlyVerboseResponse>;
                                  };
                                  getAccessTokenWithPopup: (
                                      options?: GetTokenWithPopupOptions,
                                      config?: PopupConfigOptions,
                                  ) => Promise<undefined | string>;
                                  getDpopNonce: (id?: string) => Promise<undefined | string>;
                                  getIdTokenClaims: () => Promise<undefined | IdToken>;
                                  handleRedirectCallback: (url?: string) => Promise<RedirectLoginResult<any>>;
                                  isAuthenticated: boolean;
                                  isLoading: boolean;
                                  loginWithPopup: (
                                      options?: PopupLoginOptions,
                                      config?: PopupConfigOptions,
                                  ) => Promise<void>;
                                  loginWithRedirect: (
                                      options?: RedirectLoginOptions<AppState>,
                                  ) => Promise<void>;
                                  logout: (options?: LogoutOptions) => Promise<void>;
                                  setDpopNonce: (nonce: string, id?: string) => Promise<void>;
                                  user: undefined | TUser;
                              }

                              Type Parameters

                              Hierarchy

                              • AuthState<TUser>
                                • Auth0ContextInterface
                              Index

                              Properties

                              error: undefined | Error
                              getAccessTokenSilently: {
                                  (
                                      options: GetTokenSilentlyOptions & { detailedResponse: true },
                                  ): Promise<GetTokenSilentlyVerboseResponse>;
                                  (options?: GetTokenSilentlyOptions): Promise<string>;
                                  (
                                      options: GetTokenSilentlyOptions,
                                  ): Promise<string | GetTokenSilentlyVerboseResponse>;
                              }
                              const token = await getAccessTokenSilently(options);
                              +

                              Properties

                              createFetcher: <TOutput extends CustomFetchMinimalOutput = Response>(
                                  config?: FetcherConfig<TOutput>,
                              ) => Fetcher<TOutput>

                              Returns a new Fetcher class that will contain a fetchWithAuth() method. +This is a drop-in replacement for the Fetch API's fetch() method, but will +handle certain authentication logic for you, like building the proper auth +headers or managing DPoP nonces and retries automatically.

                              +

                              Check the EXAMPLES.md file for a deeper look into this method.

                              +

                              Type declaration

                                • <TOutput extends CustomFetchMinimalOutput = Response>(
                                      config?: FetcherConfig<TOutput>,
                                  ): Fetcher<TOutput>
                                • Returns a new Fetcher class that will contain a fetchWithAuth() method. +This is a drop-in replacement for the Fetch API's fetch() method, but will +handle certain authentication logic for you, like building the proper auth +headers or managing DPoP nonces and retries automatically.

                                  +

                                  Check the EXAMPLES.md file for a deeper look into this method.

                                  +

                                  Type Parameters

                                  • TOutput extends CustomFetchMinimalOutput = Response

                                  Parameters

                                  Returns Fetcher<TOutput>

                              error: undefined | Error
                              generateDpopProof: (
                                  params: {
                                      accessToken: string;
                                      method: string;
                                      nonce?: string;
                                      url: string;
                                  },
                              ) => Promise<string>

                              Returns a string to be used to demonstrate possession of the private +key used to cryptographically bind access tokens with DPoP.

                              +

                              It requires enabling the Auth0ClientOptions.useDpop option.

                              +

                              Type declaration

                                • (
                                      params: {
                                          accessToken: string;
                                          method: string;
                                          nonce?: string;
                                          url: string;
                                      },
                                  ): Promise<string>
                                • Returns a string to be used to demonstrate possession of the private +key used to cryptographically bind access tokens with DPoP.

                                  +

                                  It requires enabling the Auth0ClientOptions.useDpop option.

                                  +

                                  Parameters

                                  • params: { accessToken: string; method: string; nonce?: string; url: string }

                                  Returns Promise<string>

                              getAccessTokenSilently: {
                                  (
                                      options: GetTokenSilentlyOptions & { detailedResponse: true },
                                  ): Promise<GetTokenSilentlyVerboseResponse>;
                                  (options?: GetTokenSilentlyOptions): Promise<string>;
                                  (
                                      options: GetTokenSilentlyOptions,
                                  ): Promise<string | GetTokenSilentlyVerboseResponse>;
                              }
                              const token = await getAccessTokenSilently(options);
                               

                              If there's a valid token stored, return it. Otherwise, opens an @@ -29,7 +49,7 @@ back to using an iframe to make the token exchange.

                              Note that in all cases, falling back to an iframe requires access to the auth0 cookie.

                              -
                              getAccessTokenWithPopup: (
                                  options?: GetTokenWithPopupOptions,
                                  config?: PopupConfigOptions,
                              ) => Promise<undefined | string>
                              const token = await getTokenWithPopup(options, config);
                              +
                              getAccessTokenWithPopup: (
                                  options?: GetTokenWithPopupOptions,
                                  config?: PopupConfigOptions,
                              ) => Promise<undefined | string>
                              const token = await getTokenWithPopup(options, config);
                               

                              Get an access token interactively.

                              @@ -37,16 +57,31 @@ provided as arguments. Random and secure state and nonce parameters will be auto-generated. If the response is successful, results will be valid according to their expiration times.

                              -
                              getIdTokenClaims: () => Promise<undefined | IdToken>
                              const claims = await getIdTokenClaims();
                              +
                              getDpopNonce: (id?: string) => Promise<undefined | string>

                              Returns the current DPoP nonce used for making requests to Auth0.

                              +

                              It can return undefined because when starting fresh it will not +be populated until after the first response from the server.

                              +

                              It requires enabling the Auth0ClientOptions.useDpop option.

                              +

                              Type declaration

                                • (id?: string): Promise<undefined | string>
                                • Returns the current DPoP nonce used for making requests to Auth0.

                                  +

                                  It can return undefined because when starting fresh it will not +be populated until after the first response from the server.

                                  +

                                  It requires enabling the Auth0ClientOptions.useDpop option.

                                  +

                                  Parameters

                                  • Optionalid: string

                                    The identifier of a nonce: if absent, it will get the nonce +used for requests to Auth0. Otherwise, it will be used to +select a specific non-Auth0 nonce.

                                    +

                                  Returns Promise<undefined | string>

                              The nonce value.

                              +

                              The identifier of a nonce: if absent, it will get the nonce +used for requests to Auth0. Otherwise, it will be used to +select a specific non-Auth0 nonce.

                              +
                              getIdTokenClaims: () => Promise<undefined | IdToken>
                              const claims = await getIdTokenClaims();
                               

                              Returns all claims from the id_token if available.

                              -
                              handleRedirectCallback: (url?: string) => Promise<RedirectLoginResult<any>>

                              After the browser redirects back to the callback page, +

                              handleRedirectCallback: (url?: string) => Promise<RedirectLoginResult<any>>

                              After the browser redirects back to the callback page, call handleRedirectCallback to handle success and error responses from Auth0. If the response is successful, results will be valid according to their expiration times.

                              Type declaration

                                • (url?: string): Promise<RedirectLoginResult<any>>
                                • Parameters

                                  • Optionalurl: string

                                    The URL to that should be used to retrieve the state and code values. Defaults to window.location.href if not given.

                                    -

                                  Returns Promise<RedirectLoginResult<any>>

                              isAuthenticated: boolean
                              isLoading: boolean
                              loginWithPopup: (
                                  options?: PopupLoginOptions,
                                  config?: PopupConfigOptions,
                              ) => Promise<void>
                              await loginWithPopup(options, config);
                              +

                              Returns Promise<RedirectLoginResult<any>>

                              isAuthenticated: boolean
                              isLoading: boolean
                              loginWithPopup: (
                                  options?: PopupLoginOptions,
                                  config?: PopupConfigOptions,
                              ) => Promise<void>
                              await loginWithPopup(options, config);
                               

                              Opens a popup with the /authorize URL using the parameters @@ -56,17 +91,29 @@

                              IMPORTANT: This method has to be called from an event handler that was started by the user like a button click, for example, otherwise the popup will be blocked in most browsers.

                              -
                              loginWithRedirect: (options?: RedirectLoginOptions<AppState>) => Promise<void>
                              await loginWithRedirect(options);
                              +
                              loginWithRedirect: (options?: RedirectLoginOptions<AppState>) => Promise<void>
                              await loginWithRedirect(options);
                               

                              Performs a redirect to /authorize using the parameters provided as arguments. Random and secure state and nonce parameters will be auto-generated.

                              -
                              logout: (options?: LogoutOptions) => Promise<void>
                              auth0.logout({ logoutParams: { returnTo: window.location.origin } });
                              +
                              logout: (options?: LogoutOptions) => Promise<void>
                              auth0.logout({ logoutParams: { returnTo: window.location.origin } });
                               

                              Clears the application session and performs a redirect to /v2/logout, using the parameters provided as arguments, to clear the Auth0 session. If the logoutParams.federated option is specified, it also clears the Identity Provider session. Read more about how Logout works at Auth0.

                              -
                              user: undefined | TUser
                              +
                              setDpopNonce: (nonce: string, id?: string) => Promise<void>

                              Sets the current DPoP nonce used for making requests to Auth0.

                              +

                              It requires enabling the Auth0ClientOptions.useDpop option.

                              +

                              Type declaration

                                • (nonce: string, id?: string): Promise<void>
                                • Sets the current DPoP nonce used for making requests to Auth0.

                                  +

                                  It requires enabling the Auth0ClientOptions.useDpop option.

                                  +

                                  Parameters

                                  • nonce: string

                                    The nonce value.

                                    +
                                  • Optionalid: string

                                    The identifier of a nonce: if absent, it will set the nonce +used for requests to Auth0. Otherwise, it will be used to +select a specific non-Auth0 nonce.

                                    +

                                  Returns Promise<void>

                              The nonce value.

                              +

                              The identifier of a nonce: if absent, it will set the nonce +used for requests to Auth0. Otherwise, it will be used to +select a specific non-Auth0 nonce.

                              +
                              user: undefined | TUser
                              diff --git a/docs/interfaces/Auth0ProviderOptions.html b/docs/interfaces/Auth0ProviderOptions.html index b20023ce..50a221a2 100644 --- a/docs/interfaces/Auth0ProviderOptions.html +++ b/docs/interfaces/Auth0ProviderOptions.html @@ -1,5 +1,5 @@ Auth0ProviderOptions | @auth0/auth0-react
                              @auth0/auth0-react
                                Preparing search index...

                                Interface Auth0ProviderOptions<TUser>

                                The main configuration to instantiate the Auth0Provider.

                                -
                                interface Auth0ProviderOptions<TUser extends User = User> {
                                    auth0Client?: {
                                        env?: { [key: string]: string };
                                        name: string;
                                        version: string;
                                    };
                                    authorizationParams?: AuthorizationParams;
                                    authorizeTimeoutInSeconds?: number;
                                    cache?: ICache;
                                    cacheLocation?: CacheLocation;
                                    children?: ReactNode;
                                    clientId: string;
                                    context?: Context<Auth0ContextInterface<TUser>>;
                                    cookieDomain?: string;
                                    domain: string;
                                    httpTimeoutInSeconds?: number;
                                    issuer?: string;
                                    leeway?: number;
                                    legacySameSiteCookie?: boolean;
                                    nowProvider?: () => number | Promise<number>;
                                    onRedirectCallback?: (appState?: AppState, user?: TUser) => void;
                                    sessionCheckExpiryDays?: number;
                                    skipRedirectCallback?: boolean;
                                    useCookiesForTransactions?: boolean;
                                    useFormData?: boolean;
                                    useRefreshTokens?: boolean;
                                    useRefreshTokensFallback?: boolean;
                                    workerUrl?: string;
                                }

                                Type Parameters

                                Hierarchy

                                • Auth0ClientOptions
                                  • Auth0ProviderOptions
                                Index

                                Properties

                                interface Auth0ProviderOptions<TUser extends User = User> {
                                    auth0Client?: {
                                        env?: { [key: string]: string };
                                        name: string;
                                        version: string;
                                    };
                                    authorizationParams?: AuthorizationParams;
                                    authorizeTimeoutInSeconds?: number;
                                    cache?: ICache;
                                    cacheLocation?: CacheLocation;
                                    children?: ReactNode;
                                    clientId: string;
                                    context?: Context<Auth0ContextInterface<TUser>>;
                                    cookieDomain?: string;
                                    domain: string;
                                    httpTimeoutInSeconds?: number;
                                    issuer?: string;
                                    leeway?: number;
                                    legacySameSiteCookie?: boolean;
                                    nowProvider?: () => number | Promise<number>;
                                    onRedirectCallback?: (appState?: AppState, user?: TUser) => void;
                                    sessionCheckExpiryDays?: number;
                                    skipRedirectCallback?: boolean;
                                    useCookiesForTransactions?: boolean;
                                    useDpop?: boolean;
                                    useFormData?: boolean;
                                    useRefreshTokens?: boolean;
                                    useRefreshTokensFallback?: boolean;
                                    workerUrl?: string;
                                }

                                Type Parameters

                                Hierarchy

                                • Auth0ClientOptions
                                  • Auth0ProviderOptions
                                Index

                                Properties

                                auth0Client?: { env?: { [key: string]: string }; name: string; version: string }

                                Internal property to send information about the client to the authorization server.

                                -
                                authorizationParams?: AuthorizationParams

                                URL parameters that will be sent back to the Authorization Server. This can be known parameters +

                                authorizationParams?: AuthorizationParams

                                URL parameters that will be sent back to the Authorization Server. This can be known parameters defined by Auth0 or custom parameters that you define.

                                -
                                authorizeTimeoutInSeconds?: number

                                A maximum number of seconds to wait before declaring background calls to /authorize as failed for timeout +

                                authorizeTimeoutInSeconds?: number

                                A maximum number of seconds to wait before declaring background calls to /authorize as failed for timeout Defaults to 60s.

                                -
                                cache?: ICache

                                Specify a custom cache implementation to use for token storage and retrieval. This setting takes precedence over cacheLocation if they are both specified.

                                -
                                cacheLocation?: CacheLocation

                                The location to use when storing cache data. Valid values are memory or localstorage. +

                                cache?: ICache

                                Specify a custom cache implementation to use for token storage and retrieval. This setting takes precedence over cacheLocation if they are both specified.

                                +
                                cacheLocation?: CacheLocation

                                The location to use when storing cache data. Valid values are memory or localstorage. The default setting is memory.

                                Read more about changing storage options in the Auth0 docs

                                -
                                children?: ReactNode

                                The child nodes your Provider has wrapped

                                -
                                clientId: string

                                The Client ID found on your Application settings page

                                -
                                context?: Context<Auth0ContextInterface<TUser>>

                                Context to be used when creating the Auth0Provider, defaults to the internally created context.

                                +
                                children?: ReactNode

                                The child nodes your Provider has wrapped

                                +
                                clientId: string

                                The Client ID found on your Application settings page

                                +
                                context?: Context<Auth0ContextInterface<TUser>>

                                Context to be used when creating the Auth0Provider, defaults to the internally created context.

                                This allows multiple Auth0Providers to be nested within the same application, the context value can then be passed to useAuth0, withAuth0, or withAuthenticationRequired to use that specific Auth0Provider to access auth state and methods specifically tied to the provider that the context belongs to.

                                @@ -46,51 +47,55 @@ used to store data is different

                                For a sample on using multiple Auth0Providers review the React Account Linking Sample

                                -
                                cookieDomain?: string

                                The domain the cookie is accessible from. If not set, the cookie is scoped to +

                                cookieDomain?: string

                                The domain the cookie is accessible from. If not set, the cookie is scoped to the current domain, including the subdomain.

                                Note: setting this incorrectly may cause silent authentication to stop working on page load.

                                To keep a user logged in across multiple subdomains set this to your top-level domain and prefixed with a . (eg: .example.com).

                                -
                                domain: string

                                Your Auth0 account domain such as 'example.auth0.com', +

                                domain: string

                                Your Auth0 account domain such as 'example.auth0.com', 'example.eu.auth0.com' or , 'example.mycompany.com' (when using custom domains)

                                -
                                httpTimeoutInSeconds?: number

                                Specify the timeout for HTTP calls using fetch. The default is 10 seconds.

                                -
                                issuer?: string

                                The issuer to be used for validation of JWTs, optionally defaults to the domain above

                                -
                                leeway?: number

                                The value in seconds used to account for clock skew in JWT expirations. +

                                httpTimeoutInSeconds?: number

                                Specify the timeout for HTTP calls using fetch. The default is 10 seconds.

                                +
                                issuer?: string

                                The issuer to be used for validation of JWTs, optionally defaults to the domain above

                                +
                                leeway?: number

                                The value in seconds used to account for clock skew in JWT expirations. Typically, this value is no more than a minute or two at maximum. Defaults to 60s.

                                -
                                legacySameSiteCookie?: boolean

                                Sets an additional cookie with no SameSite attribute to support legacy browsers +

                                legacySameSiteCookie?: boolean

                                Sets an additional cookie with no SameSite attribute to support legacy browsers that are not compatible with the latest SameSite changes. This will log a warning on modern browsers, you can disable the warning by setting this to false but be aware that some older useragents will not work, See https://www.chromium.org/updates/same-site/incompatible-clients Defaults to true

                                -
                                nowProvider?: () => number | Promise<number>

                                Modify the value used as the current time during the token validation.

                                +
                                nowProvider?: () => number | Promise<number>

                                Modify the value used as the current time during the token validation.

                                Note: Using this improperly can potentially compromise the token validation.

                                -
                                onRedirectCallback?: (appState?: AppState, user?: TUser) => void

                                By default this removes the code and state parameters from the url when you are redirected from the authorize page. +

                                onRedirectCallback?: (appState?: AppState, user?: TUser) => void

                                By default this removes the code and state parameters from the url when you are redirected from the authorize page. It uses window.history but you might want to overwrite this if you are using a custom router, like react-router-dom See the EXAMPLES.md for more info.

                                -
                                sessionCheckExpiryDays?: number

                                Number of days until the cookie auth0.is.authenticated will expire +

                                sessionCheckExpiryDays?: number

                                Number of days until the cookie auth0.is.authenticated will expire Defaults to 1.

                                -
                                skipRedirectCallback?: boolean

                                By default, if the page url has code/state params, the SDK will treat them as Auth0's and attempt to exchange the +

                                skipRedirectCallback?: boolean

                                By default, if the page url has code/state params, the SDK will treat them as Auth0's and attempt to exchange the code for a token. In some cases the code might be for something else (another OAuth SDK perhaps). In these instances you can instruct the client to ignore them eg

                                <Auth0Provider
                                clientId={clientId}
                                domain={domain}
                                skipRedirectCallback={window.location.pathname === '/stripe-oauth-callback'}
                                >
                                -
                                useCookiesForTransactions?: boolean

                                If true, the SDK will use a cookie when storing information about the auth transaction while +

                                useCookiesForTransactions?: boolean

                                If true, the SDK will use a cookie when storing information about the auth transaction while the user is going through the authentication flow on the authorization server.

                                The default is false, in which case the SDK will use session storage.

                                You might want to enable this if you rely on your users being able to authenticate using flows that may end up spanning across multiple tabs (e.g. magic links) or you cannot otherwise rely on session storage being available.

                                -
                                useFormData?: boolean

                                If true, data to the token endpoint is transmitted as x-www-form-urlencoded data, if false it will be transmitted as JSON. The default setting is true.

                                +
                                useDpop?: boolean

                                If true, DPoP (OAuth 2.0 Demonstrating Proof of Possession, RFC9449) +will be used to cryptographically bind tokens to this specific browser +so they can't be used from a different device in case of a leak.

                                +

                                The default setting is false.

                                +
                                useFormData?: boolean

                                If true, data to the token endpoint is transmitted as x-www-form-urlencoded data, if false it will be transmitted as JSON. The default setting is true.

                                Note: Setting this to false may affect you if you use Auth0 Rules and are sending custom, non-primitive data. If you disable this, please verify that your Auth0 Rules continue to work as intended.

                                -
                                useRefreshTokens?: boolean

                                If true, refresh tokens are used to fetch new access tokens from the Auth0 server. If false, the legacy technique of using a hidden iframe and the authorization_code grant with prompt=none is used. +

                                useRefreshTokens?: boolean

                                If true, refresh tokens are used to fetch new access tokens from the Auth0 server. If false, the legacy technique of using a hidden iframe and the authorization_code grant with prompt=none is used. The default setting is false.

                                Note: Use of refresh tokens must be enabled by an administrator on your Auth0 client application.

                                -
                                useRefreshTokensFallback?: boolean

                                If true, fallback to the technique of using a hidden iframe and the authorization_code grant with prompt=none when unable to use refresh tokens. If false, the iframe fallback is not used and +

                                useRefreshTokensFallback?: boolean

                                If true, fallback to the technique of using a hidden iframe and the authorization_code grant with prompt=none when unable to use refresh tokens. If false, the iframe fallback is not used and errors relating to a failed refresh_token grant should be handled appropriately. The default setting is false.

                                Note: There might be situations where doing silent auth with a Web Message response from an iframe is not possible, like when you're serving your application from the file system or a custom protocol (like in a Desktop or Native app). @@ -99,9 +104,9 @@

                                let token: string;
                                try {
                                token = await auth0.getTokenSilently();
                                } catch (e) {
                                if (e.error === 'missing_refresh_token' || e.error === 'invalid_grant') {
                                auth0.loginWithRedirect();
                                }
                                }
                                -
                                workerUrl?: string

                                If provided, the SDK will load the token worker from this URL instead of the integrated blob. An example of when this is useful is if you have strict +

                                workerUrl?: string

                                If provided, the SDK will load the token worker from this URL instead of the integrated blob. An example of when this is useful is if you have strict Content-Security-Policy (CSP) and wish to avoid needing to set worker-src: blob:. We recommend either serving the worker, which you can find in the module at <module_path>/dist/auth0-spa-js.worker.production.js, from the same host as your application or using the Auth0 CDN https://cdn.auth0.com/js/auth0-spa-js/<version>/auth0-spa-js.worker.production.js.

                                Note: The worker is only used when useRefreshTokens: true, cacheLocation: 'memory', and the cache is not custom.

                                -
                                +
                                diff --git a/docs/interfaces/AuthorizationParams.html b/docs/interfaces/AuthorizationParams.html index a40c5611..9e852fb2 100644 --- a/docs/interfaces/AuthorizationParams.html +++ b/docs/interfaces/AuthorizationParams.html @@ -1,6 +1,6 @@ AuthorizationParams | @auth0/auth0-react
                                @auth0/auth0-react
                                  Preparing search index...

                                  Interface AuthorizationParams

                                  interface AuthorizationParams {
                                      acr_values?: string;
                                      audience?: string;
                                      connection?: string;
                                      display?: "page" | "popup" | "touch" | "wap";
                                      id_token_hint?: string;
                                      invitation?: string;
                                      login_hint?: string;
                                      max_age?: string | number;
                                      organization?: string;
                                      prompt?: "none" | "login" | "consent" | "select_account";
                                      redirect_uri?: string;
                                      scope?: string;
                                      screen_hint?: string;
                                      ui_locales?: string;
                                      [key: string]: any;
                                  }

                                  Indexable

                                  • [key: string]: any

                                    If you need to send custom parameters to the Authorization Server, make sure to use the original parameter name.

                                    -
                                  Index

                                  Properties

                                  Index

                                  Properties

                                  acr_values?: string
                                  audience?: string

                                  The default audience to be used for requesting API access.

                                  -
                                  connection?: string

                                  The name of the connection configured for your application. +

                                  Properties

                                  acr_values?: string
                                  audience?: string

                                  The default audience to be used for requesting API access.

                                  +
                                  connection?: string

                                  The name of the connection configured for your application. If null, it will redirect to the Auth0 Login Page and show the Login Widget.

                                  -
                                  display?: "page" | "popup" | "touch" | "wap"
                                    +
                                  display?: "page" | "popup" | "touch" | "wap"
                                  • 'page': displays the UI with a full page view
                                  • 'popup': displays the UI with a popup window
                                  • 'touch': displays the UI in a way that leverages a touch interface
                                  • 'wap': displays the UI with a "feature phone" type interface
                                  -
                                  id_token_hint?: string

                                  Previously issued ID Token.

                                  -
                                  invitation?: string

                                  The Id of an invitation to accept. This is available from the user invitation URL that is given when participating in a user invitation flow.

                                  -
                                  login_hint?: string

                                  The user's email address or other identifier. When your app knows +

                                  id_token_hint?: string

                                  Previously issued ID Token.

                                  +
                                  invitation?: string

                                  The Id of an invitation to accept. This is available from the user invitation URL that is given when participating in a user invitation flow.

                                  +
                                  login_hint?: string

                                  The user's email address or other identifier. When your app knows which user is trying to authenticate, you can provide this parameter to pre-fill the email box or select the right session for sign-in.

                                  This currently only affects the classic Lock experience.

                                  -
                                  max_age?: string | number

                                  Maximum allowable elapsed time (in seconds) since authentication. +

                                  max_age?: string | number

                                  Maximum allowable elapsed time (in seconds) since authentication. If the last time the user authenticated is greater than this value, the user must be reauthenticated.

                                  -
                                  organization?: string

                                  The organization to log in to.

                                  +
                                  organization?: string

                                  The organization to log in to.

                                  This will specify an organization parameter in your user's login request.

                                  • If you provide an Organization ID (a string with the prefix org_), it will be validated against the org_id claim of your user's ID Token. The validation is case-sensitive.
                                  • @@ -41,25 +41,25 @@ To use an Organization Name you must have "Allow Organization Names in Authentication API" switched on in your Auth0 settings dashboard. More information is available on the Auth0 documentation portal
                                  -
                                  prompt?: "none" | "login" | "consent" | "select_account"
                                    +
                                  prompt?: "none" | "login" | "consent" | "select_account"
                                  • 'none': do not prompt user for login or consent on reauthentication
                                  • 'login': prompt user for reauthentication
                                  • 'consent': prompt user for consent before processing request
                                  • 'select_account': prompt user to select an account
                                  -
                                  redirect_uri?: string

                                  The default URL where Auth0 will redirect your browser to with +

                                  redirect_uri?: string

                                  The default URL where Auth0 will redirect your browser to with the authentication result. It must be whitelisted in the "Allowed Callback URLs" field in your Auth0 Application's settings. If not provided here, it should be provided in the other methods that provide authentication.

                                  -
                                  scope?: string

                                  The default scope to be used on authentication requests.

                                  +
                                  scope?: string

                                  The default scope to be used on authentication requests.

                                  This defaults to profile email if not set. If you are setting extra scopes and require profile and email to be included then you must include them in the provided scope.

                                  Note: The openid scope is always applied regardless of this setting.

                                  -
                                  screen_hint?: string

                                  Provides a hint to Auth0 as to what flow should be displayed. +

                                  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.

                                  -
                                  ui_locales?: string

                                  The space-separated list of language tags, ordered by preference. +

                                  ui_locales?: string

                                  The space-separated list of language tags, ordered by preference. For example: 'fr-CA fr en'.

                                  -
                                  +
                                  diff --git a/docs/interfaces/GetTokenSilentlyOptions.html b/docs/interfaces/GetTokenSilentlyOptions.html index ace8ec54..64eeff87 100644 --- a/docs/interfaces/GetTokenSilentlyOptions.html +++ b/docs/interfaces/GetTokenSilentlyOptions.html @@ -1,4 +1,4 @@ -GetTokenSilentlyOptions | @auth0/auth0-react
                                  @auth0/auth0-react
                                    Preparing search index...

                                    Interface GetTokenSilentlyOptions

                                    interface GetTokenSilentlyOptions {
                                        authorizationParams?: {
                                            audience?: string;
                                            redirect_uri?: string;
                                            scope?: string;
                                            [key: string]: any;
                                        };
                                        cacheMode?: "on"
                                        | "off"
                                        | "cache-only";
                                        detailedResponse?: boolean;
                                        timeoutInSeconds?: number;
                                    }
                                    Index

                                    Properties

                                    authorizationParams? +GetTokenSilentlyOptions | @auth0/auth0-react
                                    @auth0/auth0-react
                                      Preparing search index...

                                      Interface GetTokenSilentlyOptions

                                      interface GetTokenSilentlyOptions {
                                          authorizationParams?: {
                                              audience?: string;
                                              redirect_uri?: string;
                                              scope?: string;
                                              [key: string]: any;
                                          };
                                          cacheMode?: "on"
                                          | "off"
                                          | "cache-only";
                                          detailedResponse?: boolean;
                                          timeoutInSeconds?: number;
                                      }
                                      Index

                                      Properties

                                      authorizationParams? cacheMode? detailedResponse? timeoutInSeconds? @@ -13,13 +13,13 @@ It must be whitelisted in the "Allowed Web Origins" in your Auth0 Application's settings.

                                    • Optionalscope?: string

                                      The scope that was used in the authentication request

                                      -
                                    • cacheMode?: "on" | "off" | "cache-only"

                                      When off, ignores the cache and always sends a +

                                      cacheMode?: "on" | "off" | "cache-only"

                                      When off, ignores the cache and always sends a request to Auth0. When cache-only, only reads from the cache and never sends a request to Auth0. Defaults to on, where it both reads from the cache and sends a request to Auth0 as needed.

                                      -
                                      detailedResponse?: boolean

                                      If true, the full response from the /oauth/token endpoint (or the cache, if the cache was used) is returned +

                                      detailedResponse?: boolean

                                      If true, the full response from the /oauth/token endpoint (or the cache, if the cache was used) is returned (minus refresh_token if one was issued). Otherwise, just the access token is returned.

                                      The default is false.

                                      -
                                      timeoutInSeconds?: number

                                      A maximum number of seconds to wait before declaring the background /authorize call as failed for timeout +

                                      timeoutInSeconds?: number

                                      A maximum number of seconds to wait before declaring the background /authorize call as failed for timeout Defaults to 60s.

                                      -
                                      +
                                      diff --git a/docs/interfaces/GetTokenWithPopupOptions.html b/docs/interfaces/GetTokenWithPopupOptions.html index 5b79dc30..5c651601 100644 --- a/docs/interfaces/GetTokenWithPopupOptions.html +++ b/docs/interfaces/GetTokenWithPopupOptions.html @@ -1,8 +1,8 @@ -GetTokenWithPopupOptions | @auth0/auth0-react
                                      @auth0/auth0-react
                                        Preparing search index...

                                        Interface GetTokenWithPopupOptions

                                        interface GetTokenWithPopupOptions {
                                            authorizationParams?: AuthorizationParams;
                                            cacheMode?: "on" | "off" | "cache-only";
                                        }

                                        Hierarchy (View Summary)

                                        Index

                                        Properties

                                        authorizationParams? +GetTokenWithPopupOptions | @auth0/auth0-react
                                        @auth0/auth0-react
                                          Preparing search index...

                                          Interface GetTokenWithPopupOptions

                                          interface GetTokenWithPopupOptions {
                                              authorizationParams?: AuthorizationParams;
                                              cacheMode?: "on" | "off" | "cache-only";
                                          }

                                          Hierarchy (View Summary)

                                          Index

                                          Properties

                                          authorizationParams?: AuthorizationParams

                                          URL parameters that will be sent back to the Authorization Server. This can be known parameters defined by Auth0 or custom parameters that you define.

                                          -
                                          cacheMode?: "on" | "off" | "cache-only"

                                          When off, ignores the cache and always sends a request to Auth0. +

                                          cacheMode?: "on" | "off" | "cache-only"

                                          When off, ignores the cache and always sends a request to Auth0. When cache-only, only reads from the cache and never sends a request to Auth0. Defaults to on, where it both reads from the cache and sends a request to Auth0 as needed.

                                          -
                                          +
                                          diff --git a/docs/interfaces/ICache.html b/docs/interfaces/ICache.html index 1cf931f8..fcc029e7 100644 --- a/docs/interfaces/ICache.html +++ b/docs/interfaces/ICache.html @@ -1,5 +1,5 @@ -ICache | @auth0/auth0-react
                                          @auth0/auth0-react
                                            Preparing search index...

                                            Interface ICache

                                            interface ICache {
                                                allKeys(): MaybePromise<string[]>;
                                                get<T = Cacheable>(key: string): MaybePromise<undefined | T>;
                                                remove(key: string): MaybePromise<void>;
                                                set<T = Cacheable>(key: string, entry: T): MaybePromise<void>;
                                            }

                                            Implemented by

                                            Index

                                            Methods

                                            allKeys? +ICache | @auth0/auth0-react
                                            @auth0/auth0-react
                                              Preparing search index...

                                              Interface ICache

                                              interface ICache {
                                                  allKeys(): MaybePromise<string[]>;
                                                  get<T = Cacheable>(key: string): MaybePromise<undefined | T>;
                                                  remove(key: string): MaybePromise<void>;
                                                  set<T = Cacheable>(key: string, entry: T): MaybePromise<void>;
                                              }

                                              Implemented by

                                              Index

                                              Methods

                                              • Returns MaybePromise<string[]>

                                              • Type Parameters

                                                Parameters

                                                • key: string

                                                Returns MaybePromise<undefined | T>

                                              • Parameters

                                                • key: string

                                                Returns MaybePromise<void>

                                              • Type Parameters

                                                Parameters

                                                • key: string
                                                • entry: T

                                                Returns MaybePromise<void>

                                              +

                                              Methods

                                              • Returns MaybePromise<string[]>

                                              • Type Parameters

                                                Parameters

                                                • key: string

                                                Returns MaybePromise<undefined | T>

                                              • Parameters

                                                • key: string

                                                Returns MaybePromise<void>

                                              • Type Parameters

                                                Parameters

                                                • key: string
                                                • entry: T

                                                Returns MaybePromise<void>

                                              diff --git a/docs/interfaces/IdToken.html b/docs/interfaces/IdToken.html index 13b8f880..ff027416 100644 --- a/docs/interfaces/IdToken.html +++ b/docs/interfaces/IdToken.html @@ -1,4 +1,4 @@ -IdToken | @auth0/auth0-react
                                              @auth0/auth0-react
                                                Preparing search index...

                                                Interface IdToken

                                                interface IdToken {
                                                    __raw: string;
                                                    acr?: string;
                                                    address?: string;
                                                    amr?: string[];
                                                    at_hash?: string;
                                                    aud?: string;
                                                    auth_time?: string;
                                                    azp?: string;
                                                    birthdate?: string;
                                                    c_hash?: string;
                                                    cnf?: string;
                                                    email?: string;
                                                    email_verified?: boolean;
                                                    exp?: number;
                                                    family_name?: string;
                                                    gender?: string;
                                                    given_name?: string;
                                                    iat?: number;
                                                    iss?: string;
                                                    jti?: string;
                                                    locale?: string;
                                                    middle_name?: string;
                                                    name?: string;
                                                    nbf?: number;
                                                    nickname?: string;
                                                    nonce?: string;
                                                    org_id?: string;
                                                    org_name?: string;
                                                    phone_number?: string;
                                                    phone_number_verified?: boolean;
                                                    picture?: string;
                                                    preferred_username?: string;
                                                    profile?: string;
                                                    sid?: string;
                                                    sub_jwk?: string;
                                                    updated_at?: string;
                                                    website?: string;
                                                    zoneinfo?: string;
                                                    [key: string]: any;
                                                }

                                                Indexable

                                                • [key: string]: any
                                                Index

                                                Properties

                                                __raw +IdToken | @auth0/auth0-react
                                                @auth0/auth0-react
                                                  Preparing search index...

                                                  Interface IdToken

                                                  interface IdToken {
                                                      __raw: string;
                                                      acr?: string;
                                                      address?: string;
                                                      amr?: string[];
                                                      at_hash?: string;
                                                      aud?: string;
                                                      auth_time?: string;
                                                      azp?: string;
                                                      birthdate?: string;
                                                      c_hash?: string;
                                                      cnf?: string;
                                                      email?: string;
                                                      email_verified?: boolean;
                                                      exp?: number;
                                                      family_name?: string;
                                                      gender?: string;
                                                      given_name?: string;
                                                      iat?: number;
                                                      iss?: string;
                                                      jti?: string;
                                                      locale?: string;
                                                      middle_name?: string;
                                                      name?: string;
                                                      nbf?: number;
                                                      nickname?: string;
                                                      nonce?: string;
                                                      org_id?: string;
                                                      org_name?: string;
                                                      phone_number?: string;
                                                      phone_number_verified?: boolean;
                                                      picture?: string;
                                                      preferred_username?: string;
                                                      profile?: string;
                                                      sid?: string;
                                                      sub_jwk?: string;
                                                      updated_at?: string;
                                                      website?: string;
                                                      zoneinfo?: string;
                                                      [key: string]: any;
                                                  }

                                                  Indexable

                                                  • [key: string]: any
                                                  Index

                                                  Properties

                                                  Properties

                                                  __raw: string
                                                  acr?: string
                                                  address?: string
                                                  amr?: string[]
                                                  at_hash?: string
                                                  aud?: string
                                                  auth_time?: string
                                                  azp?: string
                                                  birthdate?: string
                                                  c_hash?: string
                                                  cnf?: string
                                                  email?: string
                                                  email_verified?: boolean
                                                  exp?: number
                                                  family_name?: string
                                                  gender?: string
                                                  given_name?: string
                                                  iat?: number
                                                  iss?: string
                                                  jti?: string
                                                  locale?: string
                                                  middle_name?: string
                                                  name?: string
                                                  nbf?: number
                                                  nickname?: string
                                                  nonce?: string
                                                  org_id?: string
                                                  org_name?: string
                                                  phone_number?: string
                                                  phone_number_verified?: boolean
                                                  picture?: string
                                                  preferred_username?: string
                                                  profile?: string
                                                  sid?: string
                                                  sub_jwk?: string
                                                  updated_at?: string
                                                  website?: string
                                                  zoneinfo?: string
                                                  +

                                                  Properties

                                                  __raw: string
                                                  acr?: string
                                                  address?: string
                                                  amr?: string[]
                                                  at_hash?: string
                                                  aud?: string
                                                  auth_time?: string
                                                  azp?: string
                                                  birthdate?: string
                                                  c_hash?: string
                                                  cnf?: string
                                                  email?: string
                                                  email_verified?: boolean
                                                  exp?: number
                                                  family_name?: string
                                                  gender?: string
                                                  given_name?: string
                                                  iat?: number
                                                  iss?: string
                                                  jti?: string
                                                  locale?: string
                                                  middle_name?: string
                                                  name?: string
                                                  nbf?: number
                                                  nickname?: string
                                                  nonce?: string
                                                  org_id?: string
                                                  org_name?: string
                                                  phone_number?: string
                                                  phone_number_verified?: boolean
                                                  picture?: string
                                                  preferred_username?: string
                                                  profile?: string
                                                  sid?: string
                                                  sub_jwk?: string
                                                  updated_at?: string
                                                  website?: string
                                                  zoneinfo?: string
                                                  diff --git a/docs/interfaces/LogoutOptions.html b/docs/interfaces/LogoutOptions.html index a05e1792..73cfe7be 100644 --- a/docs/interfaces/LogoutOptions.html +++ b/docs/interfaces/LogoutOptions.html @@ -1,11 +1,11 @@ -LogoutOptions | @auth0/auth0-react
                                                  @auth0/auth0-react
                                                    Preparing search index...

                                                    Interface LogoutOptions

                                                    interface LogoutOptions {
                                                        clientId?: null | string;
                                                        logoutParams?: {
                                                            federated?: boolean;
                                                            returnTo?: string;
                                                            [key: string]: any;
                                                        };
                                                        openUrl?: false
                                                        | ((url: string) => void | Promise<void>);
                                                    }

                                                    Hierarchy

                                                    • Omit<SPALogoutOptions, "onRedirect">
                                                      • LogoutOptions
                                                    Index

                                                    Properties

                                                    clientId? +LogoutOptions | @auth0/auth0-react
                                                    @auth0/auth0-react
                                                      Preparing search index...

                                                      Interface LogoutOptions

                                                      interface LogoutOptions {
                                                          clientId?: null | string;
                                                          logoutParams?: {
                                                              federated?: boolean;
                                                              returnTo?: string;
                                                              [key: string]: any;
                                                          };
                                                          openUrl?: false
                                                          | ((url: string) => void | Promise<void>);
                                                      }

                                                      Hierarchy

                                                      • Omit<SPALogoutOptions, "onRedirect">
                                                        • LogoutOptions
                                                      Index

                                                      Properties

                                                      clientId?: null | string

                                                      The clientId of your application.

                                                      If this property is not set, then the clientId that was used during initialization of the SDK is sent to the logout endpoint.

                                                      If this property is set to null, then no client ID value is sent to the logout endpoint.

                                                      Read more about how redirecting after logout works

                                                      -
                                                      logoutParams?: { federated?: boolean; returnTo?: string; [key: string]: any }

                                                      Parameters to pass to the logout endpoint. This can be known parameters defined by Auth0 or custom parameters +

                                                      logoutParams?: { federated?: boolean; returnTo?: string; [key: string]: any }

                                                      Parameters to pass to the logout endpoint. This can be known parameters defined by Auth0 or custom parameters you wish to provide.

                                                      Type declaration

                                                      • [key: string]: any

                                                        If you need to send custom parameters to the logout endpoint, make sure to use the original parameter name.

                                                      • Optionalfederated?: boolean

                                                        When supported by the upstream identity provider, @@ -20,7 +20,7 @@ returnTo URL must be listed in the "Allowed Logout URLs" at the account level in the Auth0 dashboard.

                                                        Read more about how redirecting after logout works

                                                        -
                                                      openUrl?: false | ((url: string) => void | Promise<void>)

                                                      Used to control the redirect and not rely on the SDK to do the actual redirect.

                                                      +
                                                      openUrl?: false | ((url: string) => void | Promise<void>)

                                                      Used to control the redirect and not rely on the SDK to do the actual redirect.

                                                      Set to false to disable the redirect, or provide a function to handle the actual redirect yourself.

                                                      await auth0.logout({
                                                      openUrl(url) {
                                                      window.location.replace(url);
                                                      }
                                                      });
                                                      @@ -28,4 +28,4 @@
                                                      import { Browser } from '@capacitor/browser';

                                                      await auth0.logout({
                                                      async openUrl(url) {
                                                      await Browser.open({ url });
                                                      }
                                                      });
                                                      -
                                                      +
                                                      diff --git a/docs/interfaces/LogoutUrlOptions.html b/docs/interfaces/LogoutUrlOptions.html index 8a7ca5cc..f5181c56 100644 --- a/docs/interfaces/LogoutUrlOptions.html +++ b/docs/interfaces/LogoutUrlOptions.html @@ -1,10 +1,10 @@ -LogoutUrlOptions | @auth0/auth0-react
                                                      @auth0/auth0-react
                                                        Preparing search index...

                                                        Interface LogoutUrlOptions

                                                        interface LogoutUrlOptions {
                                                            clientId?: null | string;
                                                            logoutParams?: {
                                                                federated?: boolean;
                                                                returnTo?: string;
                                                                [key: string]: any;
                                                            };
                                                        }
                                                        Index

                                                        Properties

                                                        clientId? +LogoutUrlOptions | @auth0/auth0-react
                                                        @auth0/auth0-react
                                                          Preparing search index...

                                                          Interface LogoutUrlOptions

                                                          interface LogoutUrlOptions {
                                                              clientId?: null | string;
                                                              logoutParams?: {
                                                                  federated?: boolean;
                                                                  returnTo?: string;
                                                                  [key: string]: any;
                                                              };
                                                          }
                                                          Index

                                                          Properties

                                                          clientId?: null | string

                                                          The clientId of your application.

                                                          If this property is not set, then the clientId that was used during initialization of the SDK is sent to the logout endpoint.

                                                          If this property is set to null, then no client ID value is sent to the logout endpoint.

                                                          Read more about how redirecting after logout works

                                                          -
                                                          logoutParams?: { federated?: boolean; returnTo?: string; [key: string]: any }

                                                          Parameters to pass to the logout endpoint. This can be known parameters defined by Auth0 or custom parameters +

                                                          logoutParams?: { federated?: boolean; returnTo?: string; [key: string]: any }

                                                          Parameters to pass to the logout endpoint. This can be known parameters defined by Auth0 or custom parameters you wish to provide.

                                                          Type declaration

                                                          • [key: string]: any

                                                            If you need to send custom parameters to the logout endpoint, make sure to use the original parameter name.

                                                          • Optionalfederated?: boolean

                                                            When supported by the upstream identity provider, @@ -19,4 +19,4 @@ returnTo URL must be listed in the "Allowed Logout URLs" at the account level in the Auth0 dashboard.

                                                            Read more about how redirecting after logout works

                                                            -
                                                          +
                                                          diff --git a/docs/interfaces/PopupConfigOptions.html b/docs/interfaces/PopupConfigOptions.html index d02c2248..28d208cc 100644 --- a/docs/interfaces/PopupConfigOptions.html +++ b/docs/interfaces/PopupConfigOptions.html @@ -1,8 +1,8 @@ -PopupConfigOptions | @auth0/auth0-react
                                                          @auth0/auth0-react
                                                            Preparing search index...

                                                            Interface PopupConfigOptions

                                                            interface PopupConfigOptions {
                                                                popup?: any;
                                                                timeoutInSeconds?: number;
                                                            }
                                                            Index

                                                            Properties

                                                            popup? +PopupConfigOptions | @auth0/auth0-react
                                                            @auth0/auth0-react
                                                              Preparing search index...

                                                              Interface PopupConfigOptions

                                                              interface PopupConfigOptions {
                                                                  popup?: any;
                                                                  timeoutInSeconds?: number;
                                                              }
                                                              Index

                                                              Properties

                                                              popup?: any

                                                              Accepts an already-created popup window to use. If not specified, the SDK will create its own. This may be useful for platforms like iOS that have security restrictions around when popups can be invoked (e.g. from a user click event)

                                                              -
                                                              timeoutInSeconds?: number

                                                              The number of seconds to wait for a popup response before +

                                                              timeoutInSeconds?: number

                                                              The number of seconds to wait for a popup response before throwing a timeout error. Defaults to 60s

                                                              -
                                                              +
                                                              diff --git a/docs/interfaces/PopupLoginOptions.html b/docs/interfaces/PopupLoginOptions.html index af2eb17d..942c0782 100644 --- a/docs/interfaces/PopupLoginOptions.html +++ b/docs/interfaces/PopupLoginOptions.html @@ -1,4 +1,4 @@ -PopupLoginOptions | @auth0/auth0-react
                                                              @auth0/auth0-react
                                                                Preparing search index...

                                                                Interface PopupLoginOptions

                                                                interface PopupLoginOptions {
                                                                    authorizationParams?: AuthorizationParams;
                                                                }

                                                                Hierarchy (View Summary)

                                                                Index

                                                                Properties

                                                                authorizationParams? +PopupLoginOptions | @auth0/auth0-react
                                                                @auth0/auth0-react
                                                                  Preparing search index...

                                                                  Interface PopupLoginOptions

                                                                  interface PopupLoginOptions {
                                                                      authorizationParams?: AuthorizationParams;
                                                                  }

                                                                  Hierarchy (View Summary)

                                                                  Index

                                                                  Properties

                                                                  authorizationParams?: AuthorizationParams

                                                                  URL parameters that will be sent back to the Authorization Server. This can be known parameters defined by Auth0 or custom parameters that you define.

                                                                  -
                                                                  +
                                                                  diff --git a/docs/interfaces/RedirectLoginOptions.html b/docs/interfaces/RedirectLoginOptions.html index e314e32b..ed6ca603 100644 --- a/docs/interfaces/RedirectLoginOptions.html +++ b/docs/interfaces/RedirectLoginOptions.html @@ -1,16 +1,16 @@ -RedirectLoginOptions | @auth0/auth0-react
                                                                  @auth0/auth0-react
                                                                    Preparing search index...

                                                                    Interface RedirectLoginOptions<TAppState>

                                                                    interface RedirectLoginOptions<TAppState = AppState> {
                                                                        appState?: TAppState;
                                                                        authorizationParams?: AuthorizationParams;
                                                                        fragment?: string;
                                                                        openUrl?: (url: string) => void | Promise<void>;
                                                                    }

                                                                    Type Parameters

                                                                    Hierarchy

                                                                    • Omit<SPARedirectLoginOptions<TAppState>, "onRedirect">
                                                                      • RedirectLoginOptions
                                                                    Index

                                                                    Properties

                                                                    appState? +RedirectLoginOptions | @auth0/auth0-react
                                                                    @auth0/auth0-react
                                                                      Preparing search index...

                                                                      Interface RedirectLoginOptions<TAppState>

                                                                      interface RedirectLoginOptions<TAppState = AppState> {
                                                                          appState?: TAppState;
                                                                          authorizationParams?: AuthorizationParams;
                                                                          fragment?: string;
                                                                          openUrl?: (url: string) => void | Promise<void>;
                                                                      }

                                                                      Type Parameters

                                                                      Hierarchy

                                                                      • Omit<SPARedirectLoginOptions<TAppState>, "onRedirect">
                                                                        • RedirectLoginOptions
                                                                      Index

                                                                      Properties

                                                                      appState?: TAppState

                                                                      Used to store state before doing the redirect

                                                                      -
                                                                      authorizationParams?: AuthorizationParams

                                                                      URL parameters that will be sent back to the Authorization Server. This can be known parameters +

                                                                      authorizationParams?: AuthorizationParams

                                                                      URL parameters that will be sent back to the Authorization Server. This can be known parameters defined by Auth0 or custom parameters that you define.

                                                                      -
                                                                      fragment?: string

                                                                      Used to add to the URL fragment before redirecting

                                                                      -
                                                                      openUrl?: (url: string) => void | Promise<void>

                                                                      Used to control the redirect and not rely on the SDK to do the actual redirect.

                                                                      +
                                                                      fragment?: string

                                                                      Used to add to the URL fragment before redirecting

                                                                      +
                                                                      openUrl?: (url: string) => void | Promise<void>

                                                                      Used to control the redirect and not rely on the SDK to do the actual redirect.

                                                                      const client = new Auth0Client({
                                                                      openUrl(url) {
                                                                      window.location.replace(url);
                                                                      }
                                                                      });
                                                                      import { Browser } from '@capacitor/browser';

                                                                      const client = new Auth0Client({
                                                                      async openUrl(url) {
                                                                      await Browser.open({ url });
                                                                      }
                                                                      });
                                                                      -
                                                                      +
                                                                      diff --git a/docs/interfaces/WithAuth0Props.html b/docs/interfaces/WithAuth0Props.html index d80f2eb4..6d19b90d 100644 --- a/docs/interfaces/WithAuth0Props.html +++ b/docs/interfaces/WithAuth0Props.html @@ -1,3 +1,3 @@ WithAuth0Props | @auth0/auth0-react
                                                                      @auth0/auth0-react
                                                                        Preparing search index...

                                                                        Interface WithAuth0Props

                                                                        Components wrapped in withAuth0 will have an additional auth0 prop

                                                                        -
                                                                        interface WithAuth0Props {
                                                                            auth0: Auth0ContextInterface;
                                                                        }
                                                                        Index

                                                                        Properties

                                                                        Properties

                                                                        +
                                                                        interface WithAuth0Props {
                                                                            auth0: Auth0ContextInterface;
                                                                        }
                                                                        Index

                                                                        Properties

                                                                        Properties

                                                                        diff --git a/docs/interfaces/WithAuthenticationRequiredOptions.html b/docs/interfaces/WithAuthenticationRequiredOptions.html index be3c8c0d..886555c4 100644 --- a/docs/interfaces/WithAuthenticationRequiredOptions.html +++ b/docs/interfaces/WithAuthenticationRequiredOptions.html @@ -1,5 +1,5 @@ WithAuthenticationRequiredOptions | @auth0/auth0-react
                                                                        @auth0/auth0-react
                                                                          Preparing search index...

                                                                          Interface WithAuthenticationRequiredOptions

                                                                          Options for the withAuthenticationRequired Higher Order Component

                                                                          -
                                                                          interface WithAuthenticationRequiredOptions {
                                                                              context?: Context<Auth0ContextInterface<User>>;
                                                                              loginOptions?: RedirectLoginOptions<AppState>;
                                                                              onBeforeAuthentication?: () => Promise<void>;
                                                                              onRedirecting?: () => Element;
                                                                              returnTo?: string | (() => string);
                                                                          }
                                                                          Index

                                                                          Properties

                                                                          interface WithAuthenticationRequiredOptions {
                                                                              context?: Context<Auth0ContextInterface<User>>;
                                                                              loginOptions?: RedirectLoginOptions<AppState>;
                                                                              onBeforeAuthentication?: () => Promise<void>;
                                                                              onRedirecting?: () => Element;
                                                                              returnTo?: string | (() => string);
                                                                          }
                                                                          Index

                                                                          Properties

                                                                          context?: Context<Auth0ContextInterface<User>>

                                                                          The context to be used when calling useAuth0, this should only be provided if you are using multiple Auth0Providers within your application and you wish to tie a specific component to a Auth0Provider other than the Auth0Provider associated with the default Auth0Context.

                                                                          -
                                                                          withAuthenticationRequired(Profile, {
                                                                          loginOptions: {
                                                                          appState: {
                                                                          customProp: 'foo'
                                                                          }
                                                                          }
                                                                          }) +
                                                                          withAuthenticationRequired(Profile, {
                                                                          loginOptions: {
                                                                          appState: {
                                                                          customProp: 'foo'
                                                                          }
                                                                          }
                                                                          })

                                                                          Pass additional login options, like extra appState to the login page. This will be merged with the returnTo option used by the onRedirectCallback handler.

                                                                          -
                                                                          onBeforeAuthentication?: () => Promise<void>
                                                                          withAuthenticationRequired(Profile, {
                                                                          onBeforeAuthentication: () => { analyticsLibrary.track('login_triggered'); }
                                                                          }) +
                                                                          onBeforeAuthentication?: () => Promise<void>
                                                                          withAuthenticationRequired(Profile, {
                                                                          onBeforeAuthentication: () => { analyticsLibrary.track('login_triggered'); }
                                                                          })

                                                                          Allows executing logic before the user is redirected to the login page.

                                                                          -
                                                                          onRedirecting?: () => Element
                                                                          withAuthenticationRequired(Profile, {
                                                                          onRedirecting: () => <div>Redirecting you to the login...</div>
                                                                          }) +
                                                                          onRedirecting?: () => Element
                                                                          withAuthenticationRequired(Profile, {
                                                                          onRedirecting: () => <div>Redirecting you to the login...</div>
                                                                          })

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

                                                                          -
                                                                          returnTo?: string | (() => string)
                                                                          withAuthenticationRequired(Profile, {
                                                                          returnTo: '/profile'
                                                                          }) +
                                                                          returnTo?: string | (() => string)
                                                                          withAuthenticationRequired(Profile, {
                                                                          returnTo: '/profile'
                                                                          })

                                                                          or

                                                                          @@ -28,4 +28,4 @@

                                                                          Add a path for the onRedirectCallback handler to return the user to after login.

                                                                          -
                                                                          +
                                                                          diff --git a/docs/modules.html b/docs/modules.html index 37915723..892db9f4 100644 --- a/docs/modules.html +++ b/docs/modules.html @@ -1 +1 @@ -@auth0/auth0-react
                                                                          @auth0/auth0-react
                                                                            Preparing search index...
                                                                            +@auth0/auth0-react
                                                                            @auth0/auth0-react
                                                                              Preparing search index...
                                                                              diff --git a/docs/types/AppState.html b/docs/types/AppState.html index 9967e928..29512f1d 100644 --- a/docs/types/AppState.html +++ b/docs/types/AppState.html @@ -1,3 +1,3 @@ AppState | @auth0/auth0-react
                                                                              @auth0/auth0-react
                                                                                Preparing search index...

                                                                                Type Alias AppState

                                                                                The state of the application before the user was redirected to the login page.

                                                                                -
                                                                                type AppState = {
                                                                                    returnTo?: string;
                                                                                    [key: string]: any;
                                                                                }

                                                                                Indexable

                                                                                • [key: string]: any
                                                                                Index

                                                                                Properties

                                                                                Properties

                                                                                returnTo?: string
                                                                                +
                                                                                type AppState = {
                                                                                    returnTo?: string;
                                                                                    [key: string]: any;
                                                                                }

                                                                                Indexable

                                                                                • [key: string]: any
                                                                                Index

                                                                                Properties

                                                                                Properties

                                                                                returnTo?: string
                                                                                diff --git a/docs/types/CacheLocation.html b/docs/types/CacheLocation.html index 53cf383d..08b27564 100644 --- a/docs/types/CacheLocation.html +++ b/docs/types/CacheLocation.html @@ -1,2 +1,2 @@ CacheLocation | @auth0/auth0-react
                                                                                @auth0/auth0-react
                                                                                  Preparing search index...

                                                                                  Type Alias CacheLocation

                                                                                  CacheLocation: "memory" | "localstorage"

                                                                                  The possible locations where tokens can be stored

                                                                                  -
                                                                                  +
                                                                                  diff --git a/docs/types/Cacheable.html b/docs/types/Cacheable.html index 30262fa8..4378e1b3 100644 --- a/docs/types/Cacheable.html +++ b/docs/types/Cacheable.html @@ -1 +1 @@ -Cacheable | @auth0/auth0-react
                                                                                  @auth0/auth0-react
                                                                                    Preparing search index...

                                                                                    Type Alias Cacheable

                                                                                    Cacheable: WrappedCacheEntry | KeyManifestEntry
                                                                                    +Cacheable | @auth0/auth0-react
                                                                                    @auth0/auth0-react
                                                                                      Preparing search index...

                                                                                      Type Alias Cacheable

                                                                                      Cacheable: WrappedCacheEntry | KeyManifestEntry
                                                                                      diff --git a/docs/types/FetcherConfig.html b/docs/types/FetcherConfig.html new file mode 100644 index 00000000..62625832 --- /dev/null +++ b/docs/types/FetcherConfig.html @@ -0,0 +1,5 @@ +FetcherConfig | @auth0/auth0-react
                                                                                      @auth0/auth0-react
                                                                                        Preparing search index...

                                                                                        Type Alias FetcherConfig<TOutput>

                                                                                        type FetcherConfig<TOutput extends CustomFetchMinimalOutput> = {
                                                                                            baseUrl?: string;
                                                                                            dpopNonceId?: string;
                                                                                            fetch?: CustomFetchImpl<TOutput>;
                                                                                            getAccessToken?: AccessTokenFactory;
                                                                                        }

                                                                                        Type Parameters

                                                                                        • TOutput extends CustomFetchMinimalOutput
                                                                                        Index

                                                                                        Properties

                                                                                        baseUrl?: string
                                                                                        dpopNonceId?: string
                                                                                        fetch?: CustomFetchImpl<TOutput>
                                                                                        getAccessToken?: AccessTokenFactory
                                                                                        diff --git a/docs/variables/Auth0Context.html b/docs/variables/Auth0Context.html index c07ff85c..9407eeb1 100644 --- a/docs/variables/Auth0Context.html +++ b/docs/variables/Auth0Context.html @@ -1,2 +1,2 @@ Auth0Context | @auth0/auth0-react
                                                                                        @auth0/auth0-react
                                                                                          Preparing search index...

                                                                                          Variable Auth0ContextConst

                                                                                          Auth0Context: Context<Auth0ContextInterface<User>> = ...

                                                                                          The Auth0 Context

                                                                                          -
                                                                                          +
                                                                                          diff --git a/package-lock.json b/package-lock.json index 1ed60ce7..a011eee2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@auth0/auth0-react", - "version": "2.4.0", + "version": "2.5.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@auth0/auth0-react", - "version": "2.4.0", + "version": "2.5.0", "license": "MIT", "dependencies": { "@auth0/auth0-spa-js": "^2.4.1" diff --git a/package.json b/package.json index 1f0b471a..53be7cc5 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "author": "Auth0", "name": "@auth0/auth0-react", - "version": "2.4.0", + "version": "2.5.0", "description": "Auth0 SDK for React Single Page Applications (SPA)", "keywords": [ "auth0",