@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.js CHANGED
@@ -771,6 +771,7 @@ var OcAddressInput = React3__namespace.forwardRef(
771
771
  }
772
772
  );
773
773
  var DEFAULT_AUTH_ORIGIN = "https://ochk.io";
774
+ var LINK_PROMPT_DISMISS_KEY = "oc:linkprompt-dismissed";
774
775
  function OcLinkedIdentities({
775
776
  authOrigin = DEFAULT_AUTH_ORIGIN,
776
777
  className,
@@ -1093,6 +1094,13 @@ function LinkPromptStep({
1093
1094
  onResolved
1094
1095
  }) {
1095
1096
  const [stage, setStage] = React3__namespace.useState("offer");
1097
+ function decline() {
1098
+ try {
1099
+ window.localStorage.setItem(LINK_PROMPT_DISMISS_KEY, String(Date.now()));
1100
+ } catch {
1101
+ }
1102
+ onResolved();
1103
+ }
1096
1104
  if (stage === "linking") {
1097
1105
  return method === "btc" ? /* @__PURE__ */ jsxRuntime.jsx(
1098
1106
  BtcLinkForm,
@@ -1112,8 +1120,8 @@ function LinkPromptStep({
1112
1120
  );
1113
1121
  }
1114
1122
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { style: panelStyle("accent"), "data-oc-linkprompt": method, children: [
1115
- /* @__PURE__ */ jsxRuntime.jsx(SectionLabel, { tone: "success", children: "\xA7 signed in" }),
1116
- /* @__PURE__ */ jsxRuntime.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." }),
1123
+ /* @__PURE__ */ jsxRuntime.jsx(SectionLabel, { tone: "success", children: "\xA7 you're signed in" }),
1124
+ /* @__PURE__ */ jsxRuntime.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." }),
1117
1125
  /* @__PURE__ */ jsxRuntime.jsxs(FormButtons, { children: [
1118
1126
  /* @__PURE__ */ jsxRuntime.jsx(
1119
1127
  "button",
@@ -1124,7 +1132,7 @@ function LinkPromptStep({
1124
1132
  children: method === "btc" ? "link a Bitcoin address" : "link an email"
1125
1133
  }
1126
1134
  ),
1127
- /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", onClick: onResolved, style: ghostBtnStyle(false), children: "skip" })
1135
+ /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", onClick: decline, style: ghostBtnStyle(false), children: "not now" })
1128
1136
  ] })
1129
1137
  ] });
1130
1138
  }
@@ -1666,7 +1674,12 @@ function OcSignIn({
1666
1674
  if (onSuccess) onSuccess(account, token);
1667
1675
  else void navigate(account);
1668
1676
  };
1669
- if (!linkPrompt) {
1677
+ let declined = false;
1678
+ try {
1679
+ declined = Boolean(window.localStorage.getItem(LINK_PROMPT_DISMISS_KEY));
1680
+ } catch {
1681
+ }
1682
+ if (!linkPrompt || declined) {
1670
1683
  proceed();
1671
1684
  return;
1672
1685
  }