@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.mjs
CHANGED
|
@@ -1136,7 +1136,8 @@ var DEFAULT_AUTH_ORIGIN = "https://ochk.io";
|
|
|
1136
1136
|
async function fetchOcLinkedIdentities(opts) {
|
|
1137
1137
|
const authOrigin = opts?.authOrigin ?? DEFAULT_AUTH_ORIGIN;
|
|
1138
1138
|
const r = await fetch(`${authOrigin}/api/auth/identities`, {
|
|
1139
|
-
credentials: "include"
|
|
1139
|
+
credentials: "include",
|
|
1140
|
+
headers: { ...tabSessionHeader() }
|
|
1140
1141
|
});
|
|
1141
1142
|
if (r.status === 401) return [];
|
|
1142
1143
|
if (!r.ok) throw new Error(`identities fetch failed: http_${r.status}`);
|
|
@@ -1156,7 +1157,8 @@ function OcLinkedIdentities({
|
|
|
1156
1157
|
setError(null);
|
|
1157
1158
|
try {
|
|
1158
1159
|
const r = await fetch(`${authOrigin}/api/auth/identities`, {
|
|
1159
|
-
credentials: "include"
|
|
1160
|
+
credentials: "include",
|
|
1161
|
+
headers: { ...tabSessionHeader() }
|
|
1160
1162
|
});
|
|
1161
1163
|
if (!r.ok) {
|
|
1162
1164
|
if (r.status === 401) {
|
|
@@ -2373,6 +2375,8 @@ function ProviderSignIn({
|
|
|
2373
2375
|
if (providers.length === 0) return null;
|
|
2374
2376
|
const providerReturnTo = returnTo.startsWith("/") ? origin ? `${origin}${returnTo}` : returnTo : returnTo;
|
|
2375
2377
|
const line = { flex: 1, height: 1, background: "var(--border, #27272a)" };
|
|
2378
|
+
const BLOCK_GAP = 16;
|
|
2379
|
+
const BUTTON_GAP = 8;
|
|
2376
2380
|
const divider = /* @__PURE__ */ jsxs(
|
|
2377
2381
|
"div",
|
|
2378
2382
|
{
|
|
@@ -2380,7 +2384,10 @@ function ProviderSignIn({
|
|
|
2380
2384
|
display: "flex",
|
|
2381
2385
|
alignItems: "center",
|
|
2382
2386
|
gap: 10,
|
|
2383
|
-
|
|
2387
|
+
// Symmetric in both orderings: in `first` mode the divider
|
|
2388
|
+
// owns the gap on both sides; at the bottom the container's
|
|
2389
|
+
// marginTop owns the gap above, so the divider only pads below.
|
|
2390
|
+
margin: first ? `${BLOCK_GAP}px 0` : `0 0 ${BLOCK_GAP}px`,
|
|
2384
2391
|
color: "var(--muted-foreground, #a1a1aa)",
|
|
2385
2392
|
fontFamily: "ui-monospace, SFMono-Regular, monospace",
|
|
2386
2393
|
fontSize: 10,
|
|
@@ -2408,7 +2415,7 @@ function ProviderSignIn({
|
|
|
2408
2415
|
gap: 10,
|
|
2409
2416
|
boxSizing: "border-box",
|
|
2410
2417
|
width: "100%",
|
|
2411
|
-
marginTop: i === 0 ? 0 :
|
|
2418
|
+
marginTop: i === 0 ? 0 : BUTTON_GAP,
|
|
2412
2419
|
padding: "0.6rem 0.875rem",
|
|
2413
2420
|
border: "1px solid var(--border, #27272a)",
|
|
2414
2421
|
borderRadius: 6,
|
|
@@ -2425,13 +2432,20 @@ function ProviderSignIn({
|
|
|
2425
2432
|
},
|
|
2426
2433
|
p.id
|
|
2427
2434
|
));
|
|
2428
|
-
return /* @__PURE__ */ jsx(
|
|
2429
|
-
|
|
2430
|
-
|
|
2431
|
-
|
|
2432
|
-
|
|
2433
|
-
|
|
2434
|
-
|
|
2435
|
+
return /* @__PURE__ */ jsx(
|
|
2436
|
+
"div",
|
|
2437
|
+
{
|
|
2438
|
+
"data-oc-signin-providers": "",
|
|
2439
|
+
style: first ? { marginBottom: 0 } : { marginTop: BLOCK_GAP },
|
|
2440
|
+
children: first ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
2441
|
+
buttons,
|
|
2442
|
+
divider
|
|
2443
|
+
] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
2444
|
+
divider,
|
|
2445
|
+
buttons
|
|
2446
|
+
] })
|
|
2447
|
+
}
|
|
2448
|
+
);
|
|
2435
2449
|
}
|
|
2436
2450
|
function WalletFlow({ authOrigin, audience, add, onSuccess }) {
|
|
2437
2451
|
const [address, setAddress] = React3.useState("");
|