@auth0/auth0-spa-js 2.9.0 → 2.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.
@@ -47,6 +47,9 @@ export declare class PopupCancelledError extends GenericError {
47
47
  popup: Window;
48
48
  constructor(popup: Window);
49
49
  }
50
+ export declare class PopupOpenError extends GenericError {
51
+ constructor();
52
+ }
50
53
  /**
51
54
  * Error thrown when the token exchange results in a `mfa_required` error
52
55
  */
@@ -13,7 +13,8 @@ export * from './global';
13
13
  */
14
14
  export declare function createAuth0Client(options: Auth0ClientOptions): Promise<Auth0Client>;
15
15
  export { Auth0Client };
16
- export { ConnectError, GenericError, AuthenticationError, TimeoutError, PopupTimeoutError, PopupCancelledError, MfaRequiredError, MissingRefreshTokenError, UseDpopNonceError } from './errors';
16
+ export { ConnectError, GenericError, AuthenticationError, TimeoutError, PopupTimeoutError, PopupCancelledError, PopupOpenError, MfaRequiredError, MissingRefreshTokenError, UseDpopNonceError } from './errors';
17
17
  export { ICache, LocalStorageCache, InMemoryCache, Cacheable, DecodedToken, CacheEntry, WrappedCacheEntry, KeyManifestEntry, MaybePromise, CacheKey, CacheKeyData } from './cache';
18
- export { type FetcherConfig } from './fetcher';
18
+ export type { FetcherConfig, Fetcher, CustomFetchMinimalOutput } from './fetcher';
19
19
  export { MyAccountApiError } from './MyAccountApiClient';
20
+ export { CustomTokenExchangeOptions } from './TokenExchange';
@@ -1,2 +1,2 @@
1
- declare const _default: "2.9.0";
1
+ declare const _default: "2.10.0";
2
2
  export default _default;
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "name": "@auth0/auth0-spa-js",
4
4
  "description": "Auth0 SDK for Single Page Applications using Authorization Code Grant Flow with PKCE",
5
5
  "license": "MIT",
6
- "version": "2.9.0",
6
+ "version": "2.10.0",
7
7
  "main": "dist/lib/auth0-spa-js.cjs.js",
8
8
  "types": "dist/typings/index.d.ts",
9
9
  "module": "dist/auth0-spa-js.production.esm.js",
@@ -53,7 +53,7 @@
53
53
  "publish:cdn": "ccu --trace"
54
54
  },
55
55
  "devDependencies": {
56
- "@auth0/component-cdn-uploader": "^2.4.0",
56
+ "@auth0/component-cdn-uploader": "^2.4.2",
57
57
  "@rollup/plugin-replace": "^4.0.0",
58
58
  "@types/cypress": "^1.1.3",
59
59
  "@types/jest": "^28.1.7",
@@ -39,6 +39,7 @@ import {
39
39
  GenericError,
40
40
  MissingRefreshTokenError,
41
41
  MissingScopesError,
42
+ PopupOpenError,
42
43
  TimeoutError
43
44
  } from './errors';
44
45
 
@@ -407,9 +408,7 @@ export class Auth0Client {
407
408
  config.popup = openPopup('');
408
409
 
409
410
  if (!config.popup) {
410
- throw new Error(
411
- 'Unable to open a popup for loginWithPopup - window.open returned `null`'
412
- );
411
+ throw new PopupOpenError();
413
412
  }
414
413
  }
415
414
 
@@ -760,7 +759,7 @@ export class Auth0Client {
760
759
  *
761
760
  * If refresh tokens are used, the token endpoint is called directly with the
762
761
  * 'refresh_token' grant. If no refresh token is available to make this call,
763
- * the SDK will only fall back to using an iframe to the '/authorize' URL if
762
+ * the SDK will only fall back to using an iframe to the '/authorize' URL if
764
763
  * the `useRefreshTokensFallback` setting has been set to `true`. By default this
765
764
  * setting is `false`.
766
765
  *
package/src/errors.ts CHANGED
@@ -84,6 +84,14 @@ export class PopupCancelledError extends GenericError {
84
84
  }
85
85
  }
86
86
 
87
+ export class PopupOpenError extends GenericError {
88
+ constructor() {
89
+ super('popup_open', 'Unable to open a popup for loginWithPopup - window.open returned `null`');
90
+ //https://github.com/Microsoft/TypeScript-wiki/blob/master/Breaking-Changes.md#extending-built-ins-like-error-array-and-map-may-no-longer-work
91
+ Object.setPrototypeOf(this, PopupOpenError.prototype);
92
+ }
93
+ }
94
+
87
95
  /**
88
96
  * Error thrown when the token exchange results in a `mfa_required` error
89
97
  */
package/src/index.ts CHANGED
@@ -29,6 +29,7 @@ export {
29
29
  TimeoutError,
30
30
  PopupTimeoutError,
31
31
  PopupCancelledError,
32
+ PopupOpenError,
32
33
  MfaRequiredError,
33
34
  MissingRefreshTokenError,
34
35
  UseDpopNonceError
@@ -48,8 +49,12 @@ export {
48
49
  CacheKeyData
49
50
  } from './cache';
50
51
 
51
- export { type FetcherConfig } from './fetcher';
52
+ export type {
53
+ FetcherConfig,
54
+ Fetcher,
55
+ CustomFetchMinimalOutput
56
+ } from './fetcher';
52
57
 
53
- export {
54
- MyAccountApiError
55
- } from './MyAccountApiClient';
58
+ export { MyAccountApiError } from './MyAccountApiClient';
59
+
60
+ export { CustomTokenExchangeOptions } from './TokenExchange';
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export default '2.9.0';
1
+ export default '2.10.0';