@auth0/auth0-react 2.1.1 → 2.2.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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "author": "Auth0",
3
3
  "name": "@auth0/auth0-react",
4
- "version": "2.1.1",
4
+ "version": "2.2.0",
5
5
  "description": "Auth0 SDK for React Single Page Applications (SPA)",
6
6
  "keywords": [
7
7
  "auth0",
@@ -96,6 +96,6 @@
96
96
  "react-dom": "^16.11.0 || ^17 || ^18"
97
97
  },
98
98
  "dependencies": {
99
- "@auth0/auth0-spa-js": "^2.0.8"
99
+ "@auth0/auth0-spa-js": "^2.1.0"
100
100
  }
101
101
  }
@@ -119,7 +119,7 @@ export interface Auth0ContextInterface<TUser extends User = User>
119
119
 
120
120
  /**
121
121
  * ```js
122
- * auth0.logout({ returnTo: window.location.origin });
122
+ * auth0.logout({ logoutParams: { returnTo: window.location.origin } });
123
123
  * ```
124
124
  *
125
125
  * Clears the application session and performs a redirect to `/v2/logout`, using
@@ -127,7 +127,7 @@ export interface Auth0ContextInterface<TUser extends User = User>
127
127
  * If the `logoutParams.federated` option is specified, it also clears the Identity Provider session.
128
128
  * [Read more about how Logout works at Auth0](https://auth0.com/docs/logout).
129
129
  */
130
- logout: (options?: LogoutOptions) => void;
130
+ logout: (options?: LogoutOptions) => Promise<void>;
131
131
 
132
132
  /**
133
133
  * After the browser redirects back to the callback page,
@@ -267,7 +267,7 @@ const Auth0Provider = (opts: Auth0ProviderOptions): JSX.Element => {
267
267
  [client]
268
268
  );
269
269
 
270
- const contextValue = useMemo(() => {
270
+ const contextValue = useMemo<Auth0ContextInterface<User>>(() => {
271
271
  return {
272
272
  ...state,
273
273
  getAccessTokenSilently,