@orangecheck/auth-client 2.10.0 → 2.12.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 +30 -5
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +30 -5
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -106,7 +106,13 @@ function OcSessionProvider({
|
|
|
106
106
|
try {
|
|
107
107
|
await fetch(`${cfg.authOrigin}${cfg.logoutPath}`, {
|
|
108
108
|
method: "POST",
|
|
109
|
-
credentials: "include"
|
|
109
|
+
credentials: "include",
|
|
110
|
+
// `keepalive` lets the logout round-trip complete even if
|
|
111
|
+
// the caller hard-navigates away in the same tick (e.g.
|
|
112
|
+
// `<OcAccountMenu>` redirects home immediately on sign-out).
|
|
113
|
+
// Without it the in-flight request is cancelled on unload
|
|
114
|
+
// and the `.ochk.io` cookie may never get cleared.
|
|
115
|
+
keepalive: true
|
|
110
116
|
});
|
|
111
117
|
} catch {
|
|
112
118
|
}
|
|
@@ -1092,13 +1098,14 @@ function LinkPromptStep({
|
|
|
1092
1098
|
authOrigin,
|
|
1093
1099
|
onResolved
|
|
1094
1100
|
}) {
|
|
1101
|
+
const what = method === "btc" ? "a Bitcoin address" : "an email";
|
|
1095
1102
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-oc-linkprompt": method, children: [
|
|
1096
1103
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: { ...panelStyle("success"), marginBottom: 16 }, children: [
|
|
1097
1104
|
/* @__PURE__ */ jsxRuntime.jsx(SectionLabel, { tone: "success", children: "\xA7 signed in" }),
|
|
1098
1105
|
/* @__PURE__ */ jsxRuntime.jsxs("p", { style: { ...bodyStyle, margin: 0 }, children: [
|
|
1099
|
-
"You
|
|
1100
|
-
|
|
1101
|
-
" \u2014
|
|
1106
|
+
"You chose to also link ",
|
|
1107
|
+
what,
|
|
1108
|
+
". Complete it below \u2014 or skip for now; it is entirely optional and changes nothing about the sign-in you just completed."
|
|
1102
1109
|
] })
|
|
1103
1110
|
] }),
|
|
1104
1111
|
method === "btc" ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -1109,7 +1116,25 @@ function LinkPromptStep({
|
|
|
1109
1116
|
onDone: onResolved,
|
|
1110
1117
|
onCancel: onResolved
|
|
1111
1118
|
}
|
|
1112
|
-
) : /* @__PURE__ */ jsxRuntime.jsx(EmailLinkForm, { authOrigin, onDone: onResolved, onCancel: onResolved })
|
|
1119
|
+
) : /* @__PURE__ */ jsxRuntime.jsx(EmailLinkForm, { authOrigin, onDone: onResolved, onCancel: onResolved }),
|
|
1120
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
1121
|
+
"div",
|
|
1122
|
+
{
|
|
1123
|
+
"data-oc-linkprompt-skip": "",
|
|
1124
|
+
style: { marginTop: 14, paddingTop: 14, borderTop: `1px solid ${V.border}` },
|
|
1125
|
+
children: [
|
|
1126
|
+
/* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", onClick: onResolved, style: ghostBtnStyle(false), children: "skip \u2014 I'll do this later" }),
|
|
1127
|
+
/* @__PURE__ */ jsxRuntime.jsxs("p", { style: { ...hintStyle, marginTop: 8 }, children: [
|
|
1128
|
+
"> ",
|
|
1129
|
+
"Changed your mind? Skipping continues you straight on \u2014 your sign-in is unaffected. You can link ",
|
|
1130
|
+
what,
|
|
1131
|
+
" anytime later from your identity page,",
|
|
1132
|
+
" ",
|
|
1133
|
+
"me.ochk.io/me/identity."
|
|
1134
|
+
] })
|
|
1135
|
+
]
|
|
1136
|
+
}
|
|
1137
|
+
)
|
|
1113
1138
|
] });
|
|
1114
1139
|
}
|
|
1115
1140
|
function EmailLinkForm({
|