mozrest-sdk-react-dev 0.3.16 → 0.3.17

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/mozrest-sdk.es.js CHANGED
@@ -129607,7 +129607,7 @@ const PaymentsEditDrawer = ({
129607
129607
  response_type: "code",
129608
129608
  client_id: config$1.stripe_client_id,
129609
129609
  scope: "read_write",
129610
- redirect_uri: `${window.location.origin}/stripe-connect`
129610
+ redirect_uri: `${window.location.origin}#stripe-connect`
129611
129611
  });
129612
129612
  const width = 500;
129613
129613
  const height = 600;
@@ -130000,10 +130000,11 @@ function Main({
130000
130000
  useEffect(() => {
130001
130001
  const handleStripeCallback = () => {
130002
130002
  var _a2, _b;
130003
- const urlParams = new URLSearchParams(window.location.search);
130004
- const code = urlParams.get("code");
130005
- const error22 = urlParams.get("error");
130006
- const errorDescription = urlParams.get("error_description");
130003
+ const hash2 = window.location.hash;
130004
+ const params = new URLSearchParams(hash2.substring(1));
130005
+ const code = params.get("code");
130006
+ const error22 = params.get("error");
130007
+ const errorDescription = params.get("error_description");
130007
130008
  if (code) {
130008
130009
  (_a2 = window.opener) == null ? void 0 : _a2.postMessage({
130009
130010
  type: "STRIPE_OAUTH_RESULT",
@@ -130019,11 +130020,11 @@ function Main({
130019
130020
  }, window.location.origin);
130020
130021
  }
130021
130022
  };
130022
- if (window.location.pathname === "/stripe-connect" && window.location.search.includes("code=")) {
130023
+ if (window.location.hash.includes("stripe-connect") && window.location.hash.includes("code=")) {
130023
130024
  handleStripeCallback();
130024
130025
  }
130025
130026
  }, []);
130026
- if (window.location.pathname === "/stripe-connect" && window.location.search.includes("code=")) {
130027
+ if (window.location.hash.includes("stripe-connect") && window.location.hash.includes("code=")) {
130027
130028
  return /* @__PURE__ */ jsx$1(SkeletonPage, {});
130028
130029
  }
130029
130030
  return /* @__PURE__ */ jsxs("div", {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mozrest-sdk-react-dev",
3
- "version": "0.3.16",
3
+ "version": "0.3.17",
4
4
  "main": "mozrest-sdk.es.js",
5
5
  "keywords": [
6
6
  "mozrest"