@auth0/auth0-react 1.5.0 → 1.9.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.
- package/README.md +3 -3
- package/dist/auth0-context.d.ts +9 -3
- package/dist/auth0-context.d.ts.map +1 -1
- package/dist/auth0-provider.d.ts +13 -1
- package/dist/auth0-provider.d.ts.map +1 -1
- package/dist/auth0-react.cjs.js +40 -25
- package/dist/auth0-react.cjs.js.map +1 -1
- package/dist/auth0-react.esm.js +39 -26
- package/dist/auth0-react.esm.js.map +1 -1
- package/dist/auth0-react.js +40 -25
- package/dist/auth0-react.js.map +1 -1
- package/dist/auth0-react.min.js +2 -2
- 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/reducer.d.ts +1 -1
- package/dist/reducer.d.ts.map +1 -1
- package/dist/utils.d.ts.map +1 -1
- package/dist/with-auth0.d.ts +2 -2
- package/dist/with-auth0.d.ts.map +1 -1
- package/dist/with-authentication-required.d.ts +1 -1
- package/dist/with-authentication-required.d.ts.map +1 -1
- package/package.json +14 -11
- package/src/auth0-context.tsx +13 -4
- package/src/auth0-provider.tsx +57 -23
- package/src/index.tsx +4 -0
- package/src/use-auth0.tsx +1 -1
- package/src/with-auth0.tsx +1 -1
- package/src/with-authentication-required.tsx +2 -2
- package/CHANGELOG.md +0 -116
package/README.md
CHANGED
|
@@ -203,7 +203,7 @@ We appreciate feedback and contribution to this repo! Before you get started, pl
|
|
|
203
203
|
|
|
204
204
|
- [Auth0's general contribution guidelines](https://github.com/auth0/open-source-template/blob/master/GENERAL-CONTRIBUTING.md)
|
|
205
205
|
- [Auth0's code of conduct guidelines](https://github.com/auth0/open-source-template/blob/master/CODE-OF-CONDUCT.md)
|
|
206
|
-
- [This repo's contribution guide](
|
|
206
|
+
- [This repo's contribution guide](https://github.com/auth0/auth0-react/blob/master/CONTRIBUTING.md)
|
|
207
207
|
|
|
208
208
|
## Support + Feedback
|
|
209
209
|
|
|
@@ -211,11 +211,11 @@ For support or to provide feedback, please [raise an issue on our issue tracker]
|
|
|
211
211
|
|
|
212
212
|
## Troubleshooting
|
|
213
213
|
|
|
214
|
-
For information on how to solve common problems, check out the [Troubleshooting](
|
|
214
|
+
For information on how to solve common problems, check out the [Troubleshooting](https://github.com/auth0/auth0-react/blob/master/TROUBLESHOOTING.md) guide
|
|
215
215
|
|
|
216
216
|
## Frequently Asked Questions
|
|
217
217
|
|
|
218
|
-
For a rundown of common issues you might encounter when using the SDK, please check out the [FAQ](
|
|
218
|
+
For a rundown of common issues you might encounter when using the SDK, please check out the [FAQ](https://github.com/auth0/auth0-react/blob/master/FAQ.md).
|
|
219
219
|
|
|
220
220
|
## Vulnerability Reporting
|
|
221
221
|
|
package/dist/auth0-context.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { BaseLoginOptions, GetIdTokenClaimsOptions, GetTokenSilentlyOptions, GetTokenWithPopupOptions, IdToken, LogoutOptions, LogoutUrlOptions, PopupLoginOptions, PopupConfigOptions, RedirectLoginOptions as Auth0RedirectLoginOptions, RedirectLoginResult, User } from '@auth0/auth0-spa-js';
|
|
2
|
+
import { BaseLoginOptions, GetIdTokenClaimsOptions, GetTokenSilentlyOptions, GetTokenWithPopupOptions, IdToken, LogoutOptions, LogoutUrlOptions, PopupLoginOptions, PopupConfigOptions, RedirectLoginOptions as Auth0RedirectLoginOptions, RedirectLoginResult, User, GetTokenSilentlyVerboseResponse } from '@auth0/auth0-spa-js';
|
|
3
3
|
import { AuthState } from './auth-state';
|
|
4
4
|
export interface RedirectLoginOptions extends BaseLoginOptions {
|
|
5
5
|
/**
|
|
@@ -46,7 +46,13 @@ export interface Auth0ContextInterface<TUser extends User = User> extends AuthSt
|
|
|
46
46
|
* Note that in all cases, falling back to an iframe requires access to
|
|
47
47
|
* the `auth0` cookie.
|
|
48
48
|
*/
|
|
49
|
-
getAccessTokenSilently:
|
|
49
|
+
getAccessTokenSilently: {
|
|
50
|
+
(options: GetTokenSilentlyOptions & {
|
|
51
|
+
detailedResponse: true;
|
|
52
|
+
}): Promise<GetTokenSilentlyVerboseResponse>;
|
|
53
|
+
(options?: GetTokenSilentlyOptions): Promise<string>;
|
|
54
|
+
(options: GetTokenSilentlyOptions): Promise<GetTokenSilentlyVerboseResponse | string>;
|
|
55
|
+
};
|
|
50
56
|
/**
|
|
51
57
|
* ```js
|
|
52
58
|
* const token = await getTokenWithPopup(options, config);
|
|
@@ -67,7 +73,7 @@ export interface Auth0ContextInterface<TUser extends User = User> extends AuthSt
|
|
|
67
73
|
*
|
|
68
74
|
* Returns all claims from the id_token if available.
|
|
69
75
|
*/
|
|
70
|
-
getIdTokenClaims: (options?: GetIdTokenClaimsOptions) => Promise<IdToken>;
|
|
76
|
+
getIdTokenClaims: (options?: GetIdTokenClaimsOptions) => Promise<IdToken | undefined>;
|
|
71
77
|
/**
|
|
72
78
|
* ```js
|
|
73
79
|
* await loginWithRedirect(options);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth0-context.d.ts","sourceRoot":"","sources":["../src/auth0-context.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,gBAAgB,EAChB,uBAAuB,EACvB,uBAAuB,EACvB,wBAAwB,EACxB,OAAO,EACP,aAAa,EACb,gBAAgB,EAChB,iBAAiB,EACjB,kBAAkB,EAClB,oBAAoB,IAAI,yBAAyB,EACjD,mBAAmB,EACnB,IAAI,
|
|
1
|
+
{"version":3,"file":"auth0-context.d.ts","sourceRoot":"","sources":["../src/auth0-context.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,gBAAgB,EAChB,uBAAuB,EACvB,uBAAuB,EACvB,wBAAwB,EACxB,OAAO,EACP,aAAa,EACb,gBAAgB,EAChB,iBAAiB,EACjB,kBAAkB,EAClB,oBAAoB,IAAI,yBAAyB,EACjD,mBAAmB,EACnB,IAAI,EACJ,+BAA+B,EAChC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AAC,CAAC;IAEnB;;;;;;;;;;;;OAYG;IACH,MAAM,EAAE,CAAC,OAAO,CAAC,EAAE,aAAa,KAAK,IAAI,CAAC;IAE1C;;;;;;;;OAQG;IACH,iBAAiB,EAAE,CAAC,OAAO,CAAC,EAAE,yBAAyB,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;IAE5E;;;;;;;OAOG;IACH,cAAc,EAAE,CAAC,OAAO,CAAC,EAAE,gBAAgB,KAAK,MAAM,CAAC;IAEvD;;;;;;;OAOG;IACH,sBAAsB,EAAE,CAAC,GAAG,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC,mBAAmB,CAAC,CAAC;CACxE;AAyBD;;GAEG;AACH,QAAA,MAAM,YAAY,sDAAuD,CAAC;AAE1E,eAAe,YAAY,CAAC"}
|
package/dist/auth0-provider.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { CacheLocation } from '@auth0/auth0-spa-js';
|
|
2
|
+
import { CacheLocation, ICache } from '@auth0/auth0-spa-js';
|
|
3
3
|
/**
|
|
4
4
|
* The state of the application before the user was redirected to the login page.
|
|
5
5
|
*/
|
|
@@ -70,6 +70,12 @@ export interface Auth0ProviderOptions {
|
|
|
70
70
|
* Read more about [changing storage options in the Auth0 docs](https://auth0.com/docs/libraries/auth0-single-page-app-sdk#change-storage-options)
|
|
71
71
|
*/
|
|
72
72
|
cacheLocation?: CacheLocation;
|
|
73
|
+
/**
|
|
74
|
+
* Specify a custom cache implementation to use for token storage and retrieval. This setting takes precedence over `cacheLocation` if they are both specified.
|
|
75
|
+
*
|
|
76
|
+
* Read more about [creating a custom cache](https://github.com/auth0/auth0-spa-js#creating-a-custom-cache)
|
|
77
|
+
*/
|
|
78
|
+
cache?: ICache;
|
|
73
79
|
/**
|
|
74
80
|
* 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.
|
|
75
81
|
* The default setting is `false`.
|
|
@@ -121,6 +127,12 @@ export interface Auth0ProviderOptions {
|
|
|
121
127
|
* 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.
|
|
122
128
|
*/
|
|
123
129
|
invitation?: string;
|
|
130
|
+
/**
|
|
131
|
+
* The name of the connection configured for your application.
|
|
132
|
+
* If null, it will redirect to the Auth0 Login Page and show
|
|
133
|
+
* the Login Widget.
|
|
134
|
+
*/
|
|
135
|
+
connection?: string;
|
|
124
136
|
/**
|
|
125
137
|
* If you need to send custom parameters to the Authorization Server,
|
|
126
138
|
* make sure to use the original parameter name.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth0-provider.d.ts","sourceRoot":"","sources":["../src/auth0-provider.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"auth0-provider.d.ts","sourceRoot":"","sources":["../src/auth0-provider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAMN,MAAM,OAAO,CAAC;AACf,OAAO,EAGL,aAAa,EAQb,MAAM,EAEP,MAAM,qBAAqB,CAAC;AAM7B;;GAEG;AACH,oBAAY,QAAQ,GAAG;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACpB,CAAC;AAEF;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC;;OAEG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B;;;;OAIG;IACH,kBAAkB,CAAC,EAAE,CAAC,QAAQ,EAAE,QAAQ,KAAK,IAAI,CAAC;IAClD;;;;;;;;;;;;OAYG;IACH,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B;;;;OAIG;IACH,MAAM,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;;;;;OAMG;IACH,WA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