@auth0/auth0-react 2.2.1 → 2.2.3
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.
- package/README.md +7 -7
- package/dist/auth0-react.cjs.js +16 -4
- package/dist/auth0-react.cjs.js.map +1 -1
- package/dist/auth0-react.esm.js +10 -5
- package/dist/auth0-react.esm.js.map +1 -1
- package/dist/auth0-react.js +16 -4
- package/dist/auth0-react.js.map +1 -1
- package/dist/auth0-react.min.js +1 -1
- package/dist/auth0-react.min.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/with-authentication-required.d.ts +1 -1
- package/package.json +12 -12
- package/src/index.tsx +7 -0
- package/src/with-authentication-required.tsx +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -3,6 +3,6 @@ export { default as useAuth0 } from './use-auth0';
|
|
|
3
3
|
export { default as withAuth0, WithAuth0Props } from './with-auth0';
|
|
4
4
|
export { default as withAuthenticationRequired, WithAuthenticationRequiredOptions, } from './with-authentication-required';
|
|
5
5
|
export { default as Auth0Context, Auth0ContextInterface, initialContext, LogoutOptions, RedirectLoginOptions, } from './auth0-context';
|
|
6
|
-
export { AuthorizationParams, PopupLoginOptions, PopupConfigOptions, GetTokenWithPopupOptions, LogoutUrlOptions, CacheLocation, GetTokenSilentlyOptions, IdToken, User, ICache, InMemoryCache, LocalStorageCache, Cacheable, } from '@auth0/auth0-spa-js';
|
|
6
|
+
export { AuthorizationParams, PopupLoginOptions, PopupConfigOptions, GetTokenWithPopupOptions, LogoutUrlOptions, CacheLocation, GetTokenSilentlyOptions, IdToken, User, ICache, InMemoryCache, LocalStorageCache, Cacheable, TimeoutError, MfaRequiredError, PopupCancelledError, PopupTimeoutError, AuthenticationError, MissingRefreshTokenError, GenericError } from '@auth0/auth0-spa-js';
|
|
7
7
|
export { OAuthError } from './errors';
|
|
8
8
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,IAAI,aAAa,EACxB,oBAAoB,EACpB,QAAQ,GACT,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AACpE,OAAO,EACL,OAAO,IAAI,0BAA0B,EACrC,iCAAiC,GAClC,MAAM,gCAAgC,CAAC;AACxC,OAAO,EACL,OAAO,IAAI,YAAY,EACvB,qBAAqB,EACrB,cAAc,EACd,aAAa,EACb,oBAAoB,GACrB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,mBAAmB,EACnB,iBAAiB,EACjB,kBAAkB,EAClB,wBAAwB,EACxB,gBAAgB,EAChB,aAAa,EACb,uBAAuB,EACvB,OAAO,EACP,IAAI,EACJ,MAAM,EACN,aAAa,EACb,iBAAiB,EACjB,SAAS,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,IAAI,aAAa,EACxB,oBAAoB,EACpB,QAAQ,GACT,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AACpE,OAAO,EACL,OAAO,IAAI,0BAA0B,EACrC,iCAAiC,GAClC,MAAM,gCAAgC,CAAC;AACxC,OAAO,EACL,OAAO,IAAI,YAAY,EACvB,qBAAqB,EACrB,cAAc,EACd,aAAa,EACb,oBAAoB,GACrB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,mBAAmB,EACnB,iBAAiB,EACjB,kBAAkB,EAClB,wBAAwB,EACxB,gBAAgB,EAChB,aAAa,EACb,uBAAuB,EACvB,OAAO,EACP,IAAI,EACJ,MAAM,EACN,aAAa,EACb,iBAAiB,EACjB,SAAS,EACT,YAAY,EACZ,gBAAgB,EAChB,mBAAmB,EACnB,iBAAiB,EACjB,mBAAmB,EACnB,wBAAwB,EACxB,YAAY,EACb,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC"}
|
|
@@ -70,7 +70,7 @@ export interface WithAuthenticationRequiredOptions {
|
|
|
70
70
|
* ```
|
|
71
71
|
*
|
|
72
72
|
* When you wrap your components in this Higher Order Component and an anonymous user visits your component
|
|
73
|
-
* they will be redirected to the login page
|
|
73
|
+
* they will be redirected to the login page; after login they will be returned to the page they were redirected from.
|
|
74
74
|
*/
|
|
75
75
|
declare const withAuthenticationRequired: <P extends object>(Component: React.ComponentType<P>, options?: WithAuthenticationRequiredOptions) => React.FC<P>;
|
|
76
76
|
export default withAuthenticationRequired;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"author": "Auth0",
|
|
3
3
|
"name": "@auth0/auth0-react",
|
|
4
|
-
"version": "2.2.
|
|
4
|
+
"version": "2.2.3",
|
|
5
5
|
"description": "Auth0 SDK for React Single Page Applications (SPA)",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"auth0",
|
|
@@ -26,19 +26,19 @@
|
|
|
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 --legacy-peer-deps && npm i --prefix=examples/nextjs-app --no-package-lock --legacy-peer-deps && npm ci --prefix=examples/users-api",
|
|
29
|
+
"install:examples": "npm i --prefix=examples/cra-react-router --no-package-lock --legacy-peer-deps && 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",
|
|
33
33
|
"start:api": "npm start --prefix=examples/users-api",
|
|
34
34
|
"test:cra": "start-server-and-test start:api 3001 start:cra http-get://127.0.0.1:3000 cypress:run",
|
|
35
35
|
"test:cra:watch": "start-server-and-test start:api 3001 start:cra 3000 cypress:open",
|
|
36
|
-
"test:gatsby": "start-server-and-test start:api 3001 start:gatsby 3000 cypress:run",
|
|
36
|
+
"test:gatsby": "start-server-and-test start:api 3001 start:gatsby http-get://localhost:3000 cypress:run",
|
|
37
37
|
"test:gatsby:watch": "start-server-and-test start:api 3001 start:gatsby 3000 cypress:open",
|
|
38
38
|
"test:nextjs": "start-server-and-test start:api 3001 start:nextjs 3000 cypress:run",
|
|
39
39
|
"test:nextjs:watch": "start-server-and-test start:api 3001 start:nextjs 3000 cypress:open",
|
|
40
40
|
"test:integration": "npm run test:cra && npm run test:gatsby && npm run test:nextjs",
|
|
41
|
-
"cypress:run": "cypress run --spec 'cypress/
|
|
41
|
+
"cypress:run": "cypress run --spec 'cypress/e2e/smoke.cy.ts'",
|
|
42
42
|
"cypress:open": "cypress open"
|
|
43
43
|
},
|
|
44
44
|
"repository": {
|
|
@@ -53,17 +53,17 @@
|
|
|
53
53
|
"devDependencies": {
|
|
54
54
|
"@rollup/plugin-node-resolve": "^15.0.1",
|
|
55
55
|
"@rollup/plugin-replace": "^5.0.1",
|
|
56
|
-
"@rollup/plugin-terser": "^0.
|
|
56
|
+
"@rollup/plugin-terser": "^0.4.3",
|
|
57
57
|
"@testing-library/jest-dom": "^5.16.5",
|
|
58
|
-
"@testing-library/react": "^
|
|
58
|
+
"@testing-library/react": "^14.0.0",
|
|
59
59
|
"@testing-library/react-hooks": "^7.0.2",
|
|
60
60
|
"@types/jest": "^29.2.3",
|
|
61
|
-
"@types/react": "^
|
|
62
|
-
"@types/react-dom": "^
|
|
61
|
+
"@types/react": "^18.2.27",
|
|
62
|
+
"@types/react-dom": "^18.2.12",
|
|
63
63
|
"@typescript-eslint/eslint-plugin": "^5.45.0",
|
|
64
64
|
"@typescript-eslint/parser": "^5.45.0",
|
|
65
65
|
"browserstack-cypress-cli": "^1.19.1",
|
|
66
|
-
"cypress": "^
|
|
66
|
+
"cypress": "^13.1.0",
|
|
67
67
|
"eslint": "^8.28.0",
|
|
68
68
|
"eslint-plugin-react": "^7.31.11",
|
|
69
69
|
"eslint-plugin-react-hooks": "^4.6.0",
|
|
@@ -84,11 +84,11 @@
|
|
|
84
84
|
"rollup-plugin-livereload": "^2.0.5",
|
|
85
85
|
"rollup-plugin-peer-deps-external": "^2.2.4",
|
|
86
86
|
"rollup-plugin-serve": "^2.0.2",
|
|
87
|
-
"rollup-plugin-typescript2": "^0.
|
|
88
|
-
"start-server-and-test": "^
|
|
87
|
+
"rollup-plugin-typescript2": "^0.36.0",
|
|
88
|
+
"start-server-and-test": "^2.0",
|
|
89
89
|
"ts-jest": "^29.0.3",
|
|
90
90
|
"tslib": "^2.4.1",
|
|
91
|
-
"typedoc": "^0.
|
|
91
|
+
"typedoc": "^0.25.3",
|
|
92
92
|
"typescript": "^4.9.4"
|
|
93
93
|
},
|
|
94
94
|
"peerDependencies": {
|
package/src/index.tsx
CHANGED
|
@@ -30,5 +30,12 @@ export {
|
|
|
30
30
|
InMemoryCache,
|
|
31
31
|
LocalStorageCache,
|
|
32
32
|
Cacheable,
|
|
33
|
+
TimeoutError,
|
|
34
|
+
MfaRequiredError,
|
|
35
|
+
PopupCancelledError,
|
|
36
|
+
PopupTimeoutError,
|
|
37
|
+
AuthenticationError,
|
|
38
|
+
MissingRefreshTokenError,
|
|
39
|
+
GenericError
|
|
33
40
|
} from '@auth0/auth0-spa-js';
|
|
34
41
|
export { OAuthError } from './errors';
|
|
@@ -92,7 +92,7 @@ export interface WithAuthenticationRequiredOptions {
|
|
|
92
92
|
* ```
|
|
93
93
|
*
|
|
94
94
|
* When you wrap your components in this Higher Order Component and an anonymous user visits your component
|
|
95
|
-
* they will be redirected to the login page
|
|
95
|
+
* they will be redirected to the login page; after login they will be returned to the page they were redirected from.
|
|
96
96
|
*/
|
|
97
97
|
const withAuthenticationRequired = <P extends object>(
|
|
98
98
|
Component: ComponentType<P>,
|