@orangecheck/auth-client 2.21.0 → 2.22.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 +25 -11
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +25 -11
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1158,7 +1158,8 @@ var DEFAULT_AUTH_ORIGIN = "https://ochk.io";
|
|
|
1158
1158
|
async function fetchOcLinkedIdentities(opts) {
|
|
1159
1159
|
const authOrigin = opts?.authOrigin ?? DEFAULT_AUTH_ORIGIN;
|
|
1160
1160
|
const r = await fetch(`${authOrigin}/api/auth/identities`, {
|
|
1161
|
-
credentials: "include"
|
|
1161
|
+
credentials: "include",
|
|
1162
|
+
headers: { ...tabSessionHeader() }
|
|
1162
1163
|
});
|
|
1163
1164
|
if (r.status === 401) return [];
|
|
1164
1165
|
if (!r.ok) throw new Error(`identities fetch failed: http_${r.status}`);
|
|
@@ -1178,7 +1179,8 @@ function OcLinkedIdentities({
|
|
|
1178
1179
|
setError(null);
|
|
1179
1180
|
try {
|
|
1180
1181
|
const r = await fetch(`${authOrigin}/api/auth/identities`, {
|
|
1181
|
-
credentials: "include"
|
|
1182
|
+
credentials: "include",
|
|
1183
|
+
headers: { ...tabSessionHeader() }
|
|
1182
1184
|
});
|
|
1183
1185
|
if (!r.ok) {
|
|
1184
1186
|
if (r.status === 401) {
|
|
@@ -2395,6 +2397,8 @@ function ProviderSignIn({
|
|
|
2395
2397
|
if (providers.length === 0) return null;
|
|
2396
2398
|
const providerReturnTo = returnTo.startsWith("/") ? origin ? `${origin}${returnTo}` : returnTo : returnTo;
|
|
2397
2399
|
const line = { flex: 1, height: 1, background: "var(--border, #27272a)" };
|
|
2400
|
+
const BLOCK_GAP = 16;
|
|
2401
|
+
const BUTTON_GAP = 8;
|
|
2398
2402
|
const divider = /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2399
2403
|
"div",
|
|
2400
2404
|
{
|
|
@@ -2402,7 +2406,10 @@ function ProviderSignIn({
|
|
|
2402
2406
|
display: "flex",
|
|
2403
2407
|
alignItems: "center",
|
|
2404
2408
|
gap: 10,
|
|
2405
|
-
|
|
2409
|
+
// Symmetric in both orderings: in `first` mode the divider
|
|
2410
|
+
// owns the gap on both sides; at the bottom the container's
|
|
2411
|
+
// marginTop owns the gap above, so the divider only pads below.
|
|
2412
|
+
margin: first ? `${BLOCK_GAP}px 0` : `0 0 ${BLOCK_GAP}px`,
|
|
2406
2413
|
color: "var(--muted-foreground, #a1a1aa)",
|
|
2407
2414
|
fontFamily: "ui-monospace, SFMono-Regular, monospace",
|
|
2408
2415
|
fontSize: 10,
|
|
@@ -2430,7 +2437,7 @@ function ProviderSignIn({
|
|
|
2430
2437
|
gap: 10,
|
|
2431
2438
|
boxSizing: "border-box",
|
|
2432
2439
|
width: "100%",
|
|
2433
|
-
marginTop: i === 0 ? 0 :
|
|
2440
|
+
marginTop: i === 0 ? 0 : BUTTON_GAP,
|
|
2434
2441
|
padding: "0.6rem 0.875rem",
|
|
2435
2442
|
border: "1px solid var(--border, #27272a)",
|
|
2436
2443
|
borderRadius: 6,
|
|
@@ -2447,13 +2454,20 @@ function ProviderSignIn({
|
|
|
2447
2454
|
},
|
|
2448
2455
|
p.id
|
|
2449
2456
|
));
|
|
2450
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2451
|
-
|
|
2452
|
-
|
|
2453
|
-
|
|
2454
|
-
|
|
2455
|
-
|
|
2456
|
-
|
|
2457
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2458
|
+
"div",
|
|
2459
|
+
{
|
|
2460
|
+
"data-oc-signin-providers": "",
|
|
2461
|
+
style: first ? { marginBottom: 0 } : { marginTop: BLOCK_GAP },
|
|
2462
|
+
children: first ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
2463
|
+
buttons,
|
|
2464
|
+
divider
|
|
2465
|
+
] }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
2466
|
+
divider,
|
|
2467
|
+
buttons
|
|
2468
|
+
] })
|
|
2469
|
+
}
|
|
2470
|
+
);
|
|
2457
2471
|
}
|
|
2458
2472
|
function WalletFlow({ authOrigin, audience, add, onSuccess }) {
|
|
2459
2473
|
const [address, setAddress] = React3__namespace.useState("");
|