@orangecheck/auth-client 2.28.0 → 2.29.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/dist/index.js +25 -18
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +25 -18
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1196,6 +1196,7 @@ var signinSize = (px) => `calc(${px}px * var(--oc-signin-scale, 1))`;
|
|
|
1196
1196
|
var signinRadius = (px) => `var(--oc-signin-radius, ${px}px)`;
|
|
1197
1197
|
var SIGNIN_BUTTON_RADIUS = "var(--oc-signin-button-radius, 6px)";
|
|
1198
1198
|
var SIGNIN_STRONG = "var(--oc-signin-strong, 600)";
|
|
1199
|
+
var SIGNIN_ARROW = "var(--oc-signin-arrow, inline)";
|
|
1199
1200
|
var DEFAULT_AUTH_ORIGIN = "https://ochk.io";
|
|
1200
1201
|
async function fetchOcLinkedIdentities(opts) {
|
|
1201
1202
|
const authOrigin = opts?.authOrigin ?? DEFAULT_AUTH_ORIGIN;
|
|
@@ -2371,7 +2372,7 @@ function OcSignIn({
|
|
|
2371
2372
|
{
|
|
2372
2373
|
active: path === "email",
|
|
2373
2374
|
onClick: () => setPath("email"),
|
|
2374
|
-
children: "
|
|
2375
|
+
children: "Email"
|
|
2375
2376
|
}
|
|
2376
2377
|
),
|
|
2377
2378
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -2379,7 +2380,7 @@ function OcSignIn({
|
|
|
2379
2380
|
{
|
|
2380
2381
|
active: path === "wallet",
|
|
2381
2382
|
onClick: () => setPath("wallet"),
|
|
2382
|
-
children: "
|
|
2383
|
+
children: "Bitcoin wallet"
|
|
2383
2384
|
}
|
|
2384
2385
|
)
|
|
2385
2386
|
] }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
@@ -2388,7 +2389,7 @@ function OcSignIn({
|
|
|
2388
2389
|
{
|
|
2389
2390
|
active: path === "wallet",
|
|
2390
2391
|
onClick: () => setPath("wallet"),
|
|
2391
|
-
children: "
|
|
2392
|
+
children: "Bitcoin wallet"
|
|
2392
2393
|
}
|
|
2393
2394
|
),
|
|
2394
2395
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -2396,7 +2397,7 @@ function OcSignIn({
|
|
|
2396
2397
|
{
|
|
2397
2398
|
active: path === "email",
|
|
2398
2399
|
onClick: () => setPath("email"),
|
|
2399
|
-
children: "
|
|
2400
|
+
children: "Email"
|
|
2400
2401
|
}
|
|
2401
2402
|
)
|
|
2402
2403
|
] })
|
|
@@ -2758,7 +2759,7 @@ function WalletFlow({
|
|
|
2758
2759
|
address.trim(),
|
|
2759
2760
|
", sign the text below, and paste the signature back here. Nothing is spent."
|
|
2760
2761
|
] }),
|
|
2761
|
-
/* @__PURE__ */ jsxRuntime.jsx(Label, { htmlFor: ids.message, children: "
|
|
2762
|
+
/* @__PURE__ */ jsxRuntime.jsx(Label, { htmlFor: ids.message, children: "Message to sign" }),
|
|
2762
2763
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2763
2764
|
"textarea",
|
|
2764
2765
|
{
|
|
@@ -2770,10 +2771,10 @@ function WalletFlow({
|
|
|
2770
2771
|
style: { ...inputStyle2, resize: "vertical" }
|
|
2771
2772
|
}
|
|
2772
2773
|
),
|
|
2773
|
-
/* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", onClick: () => void copyMessage(), style: linkButtonStyle, children: copied === "copied" ? "
|
|
2774
|
+
/* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", onClick: () => void copyMessage(), style: linkButtonStyle, children: copied === "copied" ? "Copied" : "Copy message" }),
|
|
2774
2775
|
copied === "failed" && /* @__PURE__ */ jsxRuntime.jsx(Hint, { children: "Couldn't copy here. Select the text above and copy it." }),
|
|
2775
2776
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: { marginTop: 14 }, children: [
|
|
2776
|
-
/* @__PURE__ */ jsxRuntime.jsx(Label, { htmlFor: ids.signature, children: "
|
|
2777
|
+
/* @__PURE__ */ jsxRuntime.jsx(Label, { htmlFor: ids.signature, children: "Signature" }),
|
|
2777
2778
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2778
2779
|
"textarea",
|
|
2779
2780
|
{
|
|
@@ -2799,7 +2800,7 @@ function WalletFlow({
|
|
|
2799
2800
|
type: "submit",
|
|
2800
2801
|
disabled: submitting || !pasted.trim(),
|
|
2801
2802
|
style: submitStyle(submitting || !pasted.trim()),
|
|
2802
|
-
children: submitting ? "
|
|
2803
|
+
children: submitting ? "Checking\u2026" : /* @__PURE__ */ jsxRuntime.jsx(Submit, { children: "Sign me in" })
|
|
2803
2804
|
}
|
|
2804
2805
|
),
|
|
2805
2806
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -2813,7 +2814,7 @@ function WalletFlow({
|
|
|
2813
2814
|
setCopied("idle");
|
|
2814
2815
|
},
|
|
2815
2816
|
style: linkButtonStyle,
|
|
2816
|
-
children: "
|
|
2817
|
+
children: "Use a different address"
|
|
2817
2818
|
}
|
|
2818
2819
|
)
|
|
2819
2820
|
] });
|
|
@@ -2821,7 +2822,7 @@ function WalletFlow({
|
|
|
2821
2822
|
const noBrowserWallet = wallets !== null && wallets.length === 0;
|
|
2822
2823
|
return /* @__PURE__ */ jsxRuntime.jsxs("form", { onSubmit: signIn, "data-oc-signin-wallet": "", children: [
|
|
2823
2824
|
/* @__PURE__ */ jsxRuntime.jsx(FlowHeader, { children: "Your wallet signs a short message to prove you hold the address. Nothing is spent and your key never leaves the wallet. Works with browser wallets, or any wallet that can sign a message, like Sparrow." }),
|
|
2824
|
-
/* @__PURE__ */ jsxRuntime.jsx(Label, { htmlFor: ids.address, children: "
|
|
2825
|
+
/* @__PURE__ */ jsxRuntime.jsx(Label, { htmlFor: ids.address, children: "Bitcoin address" }),
|
|
2825
2826
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2826
2827
|
"input",
|
|
2827
2828
|
{
|
|
@@ -2842,7 +2843,7 @@ function WalletFlow({
|
|
|
2842
2843
|
}
|
|
2843
2844
|
),
|
|
2844
2845
|
wallets && wallets.length > 1 && /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { marginTop: 12 }, children: [
|
|
2845
|
-
/* @__PURE__ */ jsxRuntime.jsx(Label, { htmlFor: ids.wallet, children: "
|
|
2846
|
+
/* @__PURE__ */ jsxRuntime.jsx(Label, { htmlFor: ids.wallet, children: "Sign with" }),
|
|
2846
2847
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2847
2848
|
"select",
|
|
2848
2849
|
{
|
|
@@ -2861,7 +2862,7 @@ function WalletFlow({
|
|
|
2861
2862
|
type: "submit",
|
|
2862
2863
|
disabled: submitting || !address.trim(),
|
|
2863
2864
|
style: submitStyle(submitting || !address.trim()),
|
|
2864
|
-
children: submitting ? "
|
|
2865
|
+
children: submitting ? "Waiting for wallet\u2026" : noBrowserWallet ? /* @__PURE__ */ jsxRuntime.jsx(Submit, { children: "Get the message to sign" }) : /* @__PURE__ */ jsxRuntime.jsx(Submit, { children: "Sign in with wallet" })
|
|
2865
2866
|
}
|
|
2866
2867
|
),
|
|
2867
2868
|
noBrowserWallet && /* @__PURE__ */ jsxRuntime.jsx(Hint, { children: "No browser wallet found here. You can sign with any wallet and paste." })
|
|
@@ -2959,7 +2960,7 @@ function EmailFlow({ authOrigin, add, credentials, onSuccess }) {
|
|
|
2959
2960
|
if (stage === "enter") {
|
|
2960
2961
|
return /* @__PURE__ */ jsxRuntime.jsxs("form", { onSubmit: start, "data-oc-signin-email": "", children: [
|
|
2961
2962
|
/* @__PURE__ */ jsxRuntime.jsx(FlowHeader, { children: "We email you a 6-digit code. No password, and no wallet needed to start. Link a Bitcoin address any time \u2014 that is the identity you hold yourself." }),
|
|
2962
|
-
/* @__PURE__ */ jsxRuntime.jsx(Label, { htmlFor: `${uid}-email`, children: "
|
|
2963
|
+
/* @__PURE__ */ jsxRuntime.jsx(Label, { htmlFor: `${uid}-email`, children: "Email" }),
|
|
2963
2964
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2964
2965
|
"input",
|
|
2965
2966
|
{
|
|
@@ -2978,7 +2979,7 @@ function EmailFlow({ authOrigin, add, credentials, onSuccess }) {
|
|
|
2978
2979
|
}
|
|
2979
2980
|
),
|
|
2980
2981
|
emailError && /* @__PURE__ */ jsxRuntime.jsx(ErrorLine2, { children: emailError }),
|
|
2981
|
-
/* @__PURE__ */ jsxRuntime.jsx("button", { type: "submit", disabled: submitting, style: submitStyle(submitting), children: submitting ? "
|
|
2982
|
+
/* @__PURE__ */ jsxRuntime.jsx("button", { type: "submit", disabled: submitting, style: submitStyle(submitting), children: submitting ? "Sending\u2026" : /* @__PURE__ */ jsxRuntime.jsx(Submit, { children: "Send one-time code" }) })
|
|
2982
2983
|
] });
|
|
2983
2984
|
}
|
|
2984
2985
|
return /* @__PURE__ */ jsxRuntime.jsxs("form", { onSubmit: verify, "data-oc-signin-email-verify": "", children: [
|
|
@@ -2987,7 +2988,7 @@ function EmailFlow({ authOrigin, add, credentials, onSuccess }) {
|
|
|
2987
2988
|
/* @__PURE__ */ jsxRuntime.jsx("span", { style: { color: "var(--foreground, #fafafa)" }, children: email }),
|
|
2988
2989
|
". It expires in 10 minutes."
|
|
2989
2990
|
] }),
|
|
2990
|
-
/* @__PURE__ */ jsxRuntime.jsx(Label, { htmlFor: `${uid}-code`, children: "
|
|
2991
|
+
/* @__PURE__ */ jsxRuntime.jsx(Label, { htmlFor: `${uid}-code`, children: "One-time code" }),
|
|
2991
2992
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2992
2993
|
"input",
|
|
2993
2994
|
{
|
|
@@ -3016,7 +3017,7 @@ function EmailFlow({ authOrigin, add, credentials, onSuccess }) {
|
|
|
3016
3017
|
type: "submit",
|
|
3017
3018
|
disabled: submitting || code.length !== 6,
|
|
3018
3019
|
style: submitStyle(submitting || code.length !== 6),
|
|
3019
|
-
children: submitting ? "
|
|
3020
|
+
children: submitting ? "Verifying\u2026" : /* @__PURE__ */ jsxRuntime.jsx(Submit, { children: "Verify \xB7 sign me in" })
|
|
3020
3021
|
}
|
|
3021
3022
|
),
|
|
3022
3023
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
@@ -3027,7 +3028,7 @@ function EmailFlow({ authOrigin, add, credentials, onSuccess }) {
|
|
|
3027
3028
|
onClick: () => void resend(),
|
|
3028
3029
|
disabled: submitting,
|
|
3029
3030
|
style: linkButtonStyle,
|
|
3030
|
-
children: "
|
|
3031
|
+
children: "Send a new code"
|
|
3031
3032
|
}
|
|
3032
3033
|
),
|
|
3033
3034
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -3041,12 +3042,18 @@ function EmailFlow({ authOrigin, add, credentials, onSuccess }) {
|
|
|
3041
3042
|
setResent(false);
|
|
3042
3043
|
},
|
|
3043
3044
|
style: linkButtonStyle,
|
|
3044
|
-
children: "
|
|
3045
|
+
children: "Use a different email"
|
|
3045
3046
|
}
|
|
3046
3047
|
)
|
|
3047
3048
|
] })
|
|
3048
3049
|
] });
|
|
3049
3050
|
}
|
|
3051
|
+
function Submit({ children }) {
|
|
3052
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
3053
|
+
children,
|
|
3054
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { "aria-hidden": "true", style: { display: SIGNIN_ARROW }, children: " \u2192" })
|
|
3055
|
+
] });
|
|
3056
|
+
}
|
|
3050
3057
|
function FlowHeader({
|
|
3051
3058
|
label,
|
|
3052
3059
|
children
|