cauthy-auth 0.18.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/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 res = await as("/v1/auth/webauthn/register/begin", { password });
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);