cauthy-auth 0.17.0 → 0.19.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/client.d.mts +17 -2
- package/dist/client.d.ts +17 -2
- package/dist/client.js +3 -2
- package/dist/client.js.map +1 -1
- package/dist/client.mjs +3 -2
- package/dist/client.mjs.map +1 -1
- package/dist/index.js +5 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +5 -2
- package/dist/index.mjs.map +1 -1
- package/dist/react.d.mts +21 -2
- package/dist/react.d.ts +21 -2
- package/dist/react.js +16 -7
- package/dist/react.js.map +1 -1
- package/dist/react.mjs +16 -7
- package/dist/react.mjs.map +1 -1
- package/dist/svelte.d.mts +1 -1
- package/dist/svelte.d.ts +1 -1
- package/dist/svelte.js +3 -2
- package/dist/svelte.js.map +1 -1
- package/dist/svelte.mjs +3 -2
- package/dist/svelte.mjs.map +1 -1
- package/dist/vue.d.mts +1 -1
- package/dist/vue.d.ts +1 -1
- package/dist/vue.js +3 -2
- package/dist/vue.js.map +1 -1
- package/dist/vue.mjs +3 -2
- package/dist/vue.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -994,6 +994,7 @@ function createCauthy(given = {}) {
|
|
|
994
994
|
const passkeyOf = (d) => ({
|
|
995
995
|
id: String(d?.id ?? ""),
|
|
996
996
|
name: String(d?.nickname ?? ""),
|
|
997
|
+
kind: ["security_key", "synced", "device"].includes(d?.kind) ? d.kind : "unknown",
|
|
997
998
|
createdAt: String(d?.created_at ?? ""),
|
|
998
999
|
lastUsedAt: d?.last_used_at ? String(d.last_used_at) : null
|
|
999
1000
|
});
|
|
@@ -1409,7 +1410,8 @@ function createCauthy(given = {}) {
|
|
|
1409
1410
|
return json({ status: "unlinked", provider }, 200, mine.headers);
|
|
1410
1411
|
}
|
|
1411
1412
|
if (route === "/me/passkeys/add/begin") {
|
|
1412
|
-
const
|
|
1413
|
+
const kind = b.kind === "device" || b.kind === "security_key" ? b.kind : "";
|
|
1414
|
+
const res = await as("/v1/auth/webauthn/register/begin", { password, ...kind ? { kind } : {} });
|
|
1413
1415
|
if (res.error) return refused(res, res.error.code === "step_up_required" ? "password" : void 0);
|
|
1414
1416
|
const step = { kind: "enrol", token: String(res.data?.session_id ?? ""), returnTo: afterSignIn };
|
|
1415
1417
|
const h = new Headers(mine.headers);
|
|
@@ -1469,7 +1471,8 @@ function createCauthy(given = {}) {
|
|
|
1469
1471
|
return json({ status: "verified" });
|
|
1470
1472
|
}
|
|
1471
1473
|
if (route === "/sign-in/passkey/begin") {
|
|
1472
|
-
const
|
|
1474
|
+
const email = typeof b.email === "string" && checkEmail(b.email) === null ? b.email.trim() : "";
|
|
1475
|
+
const res = await ask(request, "POST", "/v1/auth/webauthn/login/begin", email !== "" ? { email } : {});
|
|
1473
1476
|
if (res.error) return problem(res.status, res.error.code, res.error.message);
|
|
1474
1477
|
const step = { kind: "passkey", token: String(res.data?.session_id ?? ""), returnTo: afterSignIn };
|
|
1475
1478
|
return json(
|