@auth0/auth0-spa-js 2.9.1 → 2.11.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 CHANGED
@@ -30,7 +30,7 @@ npm install @auth0/auth0-spa-js
30
30
  From the CDN:
31
31
 
32
32
  ```html
33
- <script src="https://cdn.auth0.com/js/auth0-spa-js/2.9/auth0-spa-js.production.js"></script>
33
+ <script src="https://cdn.auth0.com/js/auth0-spa-js/2.11/auth0-spa-js.production.js"></script>
34
34
  ```
35
35
 
36
36
  ### Configure Auth0
@@ -540,7 +540,7 @@
540
540
  exports.default = SuperTokensLock;
541
541
  }));
542
542
  var Lock = unwrapExports(browserTabsLock);
543
- var version = "2.9.1";
543
+ var version = "2.11.0";
544
544
  const DEFAULT_AUTHORIZE_TIMEOUT_IN_SECONDS = 60;
545
545
  const DEFAULT_POPUP_CONFIG_OPTIONS = {
546
546
  timeoutInSeconds: DEFAULT_AUTHORIZE_TIMEOUT_IN_SECONDS
@@ -607,6 +607,12 @@
607
607
  Object.setPrototypeOf(this, PopupCancelledError.prototype);
608
608
  }
609
609
  }
610
+ class PopupOpenError extends GenericError {
611
+ constructor() {
612
+ super("popup_open", "Unable to open a popup for loginWithPopup - window.open returned `null`");
613
+ Object.setPrototypeOf(this, PopupOpenError.prototype);
614
+ }
615
+ }
610
616
  class MfaRequiredError extends GenericError {
611
617
  constructor(error, error_description, mfa_token) {
612
618
  super(error, error_description);
@@ -2394,7 +2400,7 @@
2394
2400
  if (!config.popup) {
2395
2401
  config.popup = openPopup("");
2396
2402
  if (!config.popup) {
2397
- throw new Error("Unable to open a popup for loginWithPopup - window.open returned `null`");
2403
+ throw new PopupOpenError;
2398
2404
  }
2399
2405
  }
2400
2406
  const params = await this._prepareAuthorizeUrl(options.authorizationParams || {}, {
@@ -2839,7 +2845,8 @@
2839
2845
  subject_token: options.subject_token,
2840
2846
  subject_token_type: options.subject_token_type,
2841
2847
  scope: scopesToRequest(this.scope, options.scope, options.audience || this.options.authorizationParams.audience),
2842
- audience: options.audience || this.options.authorizationParams.audience
2848
+ audience: options.audience || this.options.authorizationParams.audience,
2849
+ organization: options.organization || this.options.authorizationParams.organization
2843
2850
  });
2844
2851
  }
2845
2852
  _assertDpop(dpop) {
@@ -2929,6 +2936,7 @@
2929
2936
  exports.MissingRefreshTokenError = MissingRefreshTokenError;
2930
2937
  exports.MyAccountApiError = MyAccountApiError;
2931
2938
  exports.PopupCancelledError = PopupCancelledError;
2939
+ exports.PopupOpenError = PopupOpenError;
2932
2940
  exports.PopupTimeoutError = PopupTimeoutError;
2933
2941
  exports.TimeoutError = TimeoutError;
2934
2942
  exports.UseDpopNonceError = UseDpopNonceError;