@auth0/auth0-react 1.9.0 → 1.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"with-auth0.d.ts","sourceRoot":"","sources":["../src/with-auth0.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAC7C,OAAqB,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAEtE;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,qBAAqB,CAAC;CAC9B;AAED;;;;;;;;;;;;;;GAcG;AACH,QAAA,MAAM,SAAS,wGAQd,CAAC;AAEF,eAAe,SAAS,CAAC"}
1
+ {"version":3,"file":"with-auth0.d.ts","sourceRoot":"","sources":["../src/with-auth0.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAC7C,OAAqB,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAEtE;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,qBAAqB,CAAC;CAC9B;AAED;;;;;;;;;;;;;;GAcG;AACH,QAAA,MAAM,SAAS,wGAYd,CAAC;AAEF,eAAe,SAAS,CAAC"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "author": "Auth0",
3
3
  "name": "@auth0/auth0-react",
4
- "version": "1.9.0",
4
+ "version": "1.10.0",
5
5
  "description": "Auth0 SDK for React Single Page Applications (SPA)",
6
6
  "keywords": [
7
7
  "auth0",
@@ -26,7 +26,7 @@
26
26
  "test": "jest --coverage",
27
27
  "prepack": "npm run build",
28
28
  "docs": "typedoc --options typedoc.js src",
29
- "install:examples": "npm i --prefix=examples/cra-react-router --no-package-lock && npm i --prefix=examples/gatsby-app --no-package-lock && npm i --prefix=examples/nextjs-app --no-package-lock && npm ci --prefix=examples/users-api",
29
+ "install:examples": "npm i --prefix=examples/cra-react-router --no-package-lock && npm i --prefix=examples/gatsby-app --no-package-lock --legacy-peer-deps && npm i --prefix=examples/nextjs-app --no-package-lock --legacy-peer-deps && npm ci --prefix=examples/users-api",
30
30
  "start:cra": "npm start --prefix=examples/cra-react-router",
31
31
  "start:gatsby": "npm start --prefix=examples/gatsby-app",
32
32
  "start:nextjs": "npm run dev --prefix=examples/nextjs-app",
@@ -52,49 +52,49 @@
52
52
  },
53
53
  "homepage": "https://github.com/auth0/auth0-react#readme",
54
54
  "devDependencies": {
55
- "@rollup/plugin-node-resolve": "^7.1.3",
56
- "@rollup/plugin-replace": "^2.3.2",
57
- "@testing-library/jest-dom": "^5.5.0",
58
- "@testing-library/react": "^10.0.4",
59
- "@testing-library/react-hooks": "^3.2.1",
60
- "@types/jest": "^27.4.0",
61
- "@types/react": "^16.9.34",
62
- "@types/react-dom": "^16.9.6",
63
- "@typescript-eslint/eslint-plugin": "^2.30.0",
64
- "@typescript-eslint/parser": "^2.30.0",
65
- "browserstack-cypress-cli": "^1.8.1",
66
- "codecov": "^3.7.2",
67
- "cypress": "^7.2.0",
68
- "eslint": "^6.8.0",
69
- "eslint-plugin-react": "^7.19.0",
70
- "eslint-plugin-react-hooks": "^4.0.0",
55
+ "@rollup/plugin-node-resolve": "^13.1.3",
56
+ "@rollup/plugin-replace": "^4.0.0",
57
+ "@testing-library/jest-dom": "^5.16.3",
58
+ "@testing-library/react": "^13.0.0",
59
+ "@testing-library/react-hooks": "^7.0.2",
60
+ "@types/jest": "^27.4.1",
61
+ "@types/react": "^17.0.43",
62
+ "@types/react-dom": "^17.0.14",
63
+ "@typescript-eslint/eslint-plugin": "^5.17.0",
64
+ "@typescript-eslint/parser": "^5.17.0",
65
+ "browserstack-cypress-cli": "^1.1.2",
66
+ "codecov": "^3.8.2",
67
+ "cypress": "^9.5.3",
68
+ "eslint": "^8.12.0",
69
+ "eslint-plugin-react": "^7.29.4",
70
+ "eslint-plugin-react-hooks": "^4.4.0",
71
71
  "husky": "^4.2.5",
72
- "jest": "^27.4.7",
73
- "jest-junit": "^10.0.0",
74
- "oidc-provider": "^7.6.0",
75
- "prettier": "2.0.5",
76
- "pretty-quick": "^2.0.1",
77
- "react": "^16.14.0",
78
- "react-dom": "^16.14.0",
79
- "react-test-renderer": "^16.13.1",
80
- "rollup": "^2.7.2",
81
- "rollup-plugin-analyzer": "^3.3.0",
82
- "rollup-plugin-delete": "^1.2.0",
72
+ "jest": "^27.5.1",
73
+ "jest-junit": "^13.0.0",
74
+ "oidc-provider": "^7.10.6",
75
+ "prettier": "2.6.2",
76
+ "pretty-quick": "^3.1.3",
77
+ "react": "^18.0.0",
78
+ "react-dom": "^18.0.0",
79
+ "react-test-renderer": "^18.0.0",
80
+ "rollup": "^2.70.1",
81
+ "rollup-plugin-analyzer": "^4.0.0",
82
+ "rollup-plugin-delete": "^2.0.0",
83
83
  "rollup-plugin-dev": "^1.1.3",
84
- "rollup-plugin-livereload": "^1.2.0",
85
- "rollup-plugin-peer-deps-external": "^2.2.2",
86
- "rollup-plugin-serve": "^1.0.1",
87
- "rollup-plugin-terser": "^7.0.0",
88
- "rollup-plugin-typescript2": "^0.27.0",
89
- "start-server-and-test": "^1.11.0",
90
- "ts-jest": "^27.1.2",
91
- "tslib": "^1.11.1",
92
- "typedoc": "^0.20.32",
93
- "typescript": "^4.5.4"
84
+ "rollup-plugin-livereload": "^2.0.5",
85
+ "rollup-plugin-peer-deps-external": "^2.2.4",
86
+ "rollup-plugin-serve": "^1.1.0",
87
+ "rollup-plugin-terser": "^7.0.2",
88
+ "rollup-plugin-typescript2": "^0.31.2",
89
+ "start-server-and-test": "^1.14.0",
90
+ "ts-jest": "^27.1.4",
91
+ "tslib": "^2.3.1",
92
+ "typedoc": "^0.22.13",
93
+ "typescript": "^4.6.3"
94
94
  },
95
95
  "peerDependencies": {
96
- "react": "^16.11.0 || ^17",
97
- "react-dom": "^16.11.0 || ^17"
96
+ "react": "^16.11.0 || ^17 || ^18",
97
+ "react-dom": "^16.11.0 || ^17 || ^18"
98
98
  },
99
99
  "husky": {
100
100
  "hooks": {
@@ -102,6 +102,6 @@
102
102
  }
103
103
  },
104
104
  "dependencies": {
105
- "@auth0/auth0-spa-js": "^1.19.3"
105
+ "@auth0/auth0-spa-js": "^1.21.0"
106
106
  }
107
107
  }
@@ -45,7 +45,7 @@ export interface Auth0ProviderOptions {
45
45
  * It uses `window.history` but you might want to overwrite this if you are using a custom router, like `react-router-dom`
46
46
  * See the EXAMPLES.md for more info.
47
47
  */
48
- onRedirectCallback?: (appState: AppState) => void;
48
+ onRedirectCallback?: (appState?: AppState) => void;
49
49
  /**
50
50
  * By default, if the page url has code/state params, the SDK will treat them as Auth0's and attempt to exchange the
51
51
  * code for a token. In some cases the code might be for something else (another OAuth SDK perhaps). In these
@@ -25,12 +25,16 @@ export interface WithAuth0Props {
25
25
  */
26
26
  const withAuth0 = <P extends WithAuth0Props>(
27
27
  Component: ComponentType<P>
28
- ): ComponentType<Omit<P, keyof WithAuth0Props>> => (props): JSX.Element => (
29
- <Auth0Context.Consumer>
30
- {(auth: Auth0ContextInterface): JSX.Element => (
31
- <Component {...(props as P)} auth0={auth} />
32
- )}
33
- </Auth0Context.Consumer>
34
- );
28
+ ): ComponentType<Omit<P, keyof WithAuth0Props>> => {
29
+ return function WithAuth(props): JSX.Element {
30
+ return (
31
+ <Auth0Context.Consumer>
32
+ {(auth: Auth0ContextInterface): JSX.Element => (
33
+ <Component {...(props as P)} auth0={auth} />
34
+ )}
35
+ </Auth0Context.Consumer>
36
+ );
37
+ };
38
+ };
35
39
 
36
40
  export default withAuth0;