@orangecheck/auth-client 2.4.1 → 2.5.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
@@ -762,6 +762,7 @@ function OcSignIn({
762
762
  audience,
763
763
  returnTo,
764
764
  onSuccess,
765
+ resolveReturnTo,
765
766
  authOrigin = "https://ochk.io",
766
767
  initialPath = "wallet",
767
768
  paths,
@@ -772,14 +773,22 @@ function OcSignIn({
772
773
  const safeReturn = safeReturnTo(returnTo);
773
774
  const [path, setPath] = React4.useState(initialPath);
774
775
  const handleSuccess = React4.useCallback(
775
- (account) => {
776
+ async (account, token) => {
776
777
  if (onSuccess) {
777
- onSuccess(account);
778
+ onSuccess(account, token);
778
779
  return;
779
780
  }
781
+ if (resolveReturnTo) {
782
+ try {
783
+ const target = await resolveReturnTo(account);
784
+ hardNavigate(safeReturnTo(target));
785
+ return;
786
+ } catch {
787
+ }
788
+ }
780
789
  hardNavigate(safeReturn);
781
790
  },
782
- [onSuccess, safeReturn]
791
+ [onSuccess, resolveReturnTo, safeReturn]
783
792
  );
784
793
  if (!walletEnabled && !emailEnabled) {
785
794
  return /* @__PURE__ */ jsxs(
@@ -935,7 +944,7 @@ function WalletFlow({ authOrigin, audience, onSuccess }) {
935
944
  "reason" in json && json.reason || "error" in json && json.error || `verify_failed_${res.status}`
936
945
  );
937
946
  }
938
- onSuccess(json.account);
947
+ onSuccess(json.account, json.token);
939
948
  } catch (err) {
940
949
  const msg = err instanceof Error ? err.message : "sign-in failed";
941
950
  setError(msg);
@@ -1036,7 +1045,7 @@ function EmailFlow({ authOrigin, onSuccess }) {
1036
1045
  "reason" in json && json.reason || "error" in json && json.error || `verify failed (${res.status})`
1037
1046
  );
1038
1047
  }
1039
- onSuccess(json.account);
1048
+ onSuccess(json.account, json.token);
1040
1049
  } catch (err) {
1041
1050
  setCodeError(err instanceof Error ? err.message : "verify failed");
1042
1051
  } finally {
@@ -1190,7 +1199,10 @@ var inputStyle = {
1190
1199
  border: "1px solid var(--input, #27272a)",
1191
1200
  borderRadius: 6,
1192
1201
  fontFamily: "ui-monospace, SFMono-Regular, monospace",
1193
- fontSize: 13,
1202
+ // 16px — never below it. A sub-16px font-size makes iOS Safari
1203
+ // auto-zoom the viewport on focus; the family rule is >=16px on
1204
+ // every form field. Desktop reads fine at 16 too.
1205
+ fontSize: 16,
1194
1206
  outline: "none"
1195
1207
  };
1196
1208
  function submitStyle(disabled) {