@orangecheck/auth-client 2.9.0 → 2.9.1

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/dist/index.mjs CHANGED
@@ -749,6 +749,7 @@ var OcAddressInput = React3.forwardRef(
749
749
  }
750
750
  );
751
751
  var DEFAULT_AUTH_ORIGIN = "https://ochk.io";
752
+ var LINK_PROMPT_DISMISS_KEY = "oc:linkprompt-dismissed";
752
753
  function OcLinkedIdentities({
753
754
  authOrigin = DEFAULT_AUTH_ORIGIN,
754
755
  className,
@@ -1071,6 +1072,13 @@ function LinkPromptStep({
1071
1072
  onResolved
1072
1073
  }) {
1073
1074
  const [stage, setStage] = React3.useState("offer");
1075
+ function decline() {
1076
+ try {
1077
+ window.localStorage.setItem(LINK_PROMPT_DISMISS_KEY, String(Date.now()));
1078
+ } catch {
1079
+ }
1080
+ onResolved();
1081
+ }
1074
1082
  if (stage === "linking") {
1075
1083
  return method === "btc" ? /* @__PURE__ */ jsx(
1076
1084
  BtcLinkForm,
@@ -1090,8 +1098,8 @@ function LinkPromptStep({
1090
1098
  );
1091
1099
  }
1092
1100
  return /* @__PURE__ */ jsxs("div", { style: panelStyle("accent"), "data-oc-linkprompt": method, children: [
1093
- /* @__PURE__ */ jsx(SectionLabel, { tone: "success", children: "\xA7 signed in" }),
1094
- /* @__PURE__ */ jsx("p", { style: bodyStyle, children: method === "btc" ? "You're in. Link a Bitcoin address now \u2014 a second way to sign in, and it unlocks your on-chain footprint. You prove it with one wallet signature, right here \u2014 no separate trip to your account page." : "You're in. Add your email now \u2014 a backup way to sign in if you ever lose your wallet. You prove it with a one-time code, right here \u2014 no separate trip to your account page." }),
1101
+ /* @__PURE__ */ jsx(SectionLabel, { tone: "success", children: "\xA7 you're signed in" }),
1102
+ /* @__PURE__ */ jsx("p", { style: bodyStyle, children: method === "btc" ? "Optional \u2014 link a Bitcoin address and it becomes a second way to sign in, and unlocks your on-chain footprint. One wallet signature, right here. No pressure: you can always do this later from your account page." : "Optional \u2014 add your email as a backup way to sign in if you ever lose your wallet. One six-digit code, right here. No pressure: you can always do this later from your account page." }),
1095
1103
  /* @__PURE__ */ jsxs(FormButtons, { children: [
1096
1104
  /* @__PURE__ */ jsx(
1097
1105
  "button",
@@ -1102,7 +1110,7 @@ function LinkPromptStep({
1102
1110
  children: method === "btc" ? "link a Bitcoin address" : "link an email"
1103
1111
  }
1104
1112
  ),
1105
- /* @__PURE__ */ jsx("button", { type: "button", onClick: onResolved, style: ghostBtnStyle(false), children: "skip" })
1113
+ /* @__PURE__ */ jsx("button", { type: "button", onClick: decline, style: ghostBtnStyle(false), children: "not now" })
1106
1114
  ] })
1107
1115
  ] });
1108
1116
  }
@@ -1644,7 +1652,12 @@ function OcSignIn({
1644
1652
  if (onSuccess) onSuccess(account, token);
1645
1653
  else void navigate(account);
1646
1654
  };
1647
- if (!linkPrompt) {
1655
+ let declined = false;
1656
+ try {
1657
+ declined = Boolean(window.localStorage.getItem(LINK_PROMPT_DISMISS_KEY));
1658
+ } catch {
1659
+ }
1660
+ if (!linkPrompt || declined) {
1648
1661
  proceed();
1649
1662
  return;
1650
1663
  }