@calimero-network/mero-js 29.7.5 → 29.7.6

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
@@ -1857,8 +1857,8 @@ function pageDeployment(href) {
1857
1857
  return null;
1858
1858
  }
1859
1859
  }
1860
- function userVerificationOf(named) {
1861
- return named === "required" || named === "preferred" || named === "discouraged" ? named : "required";
1860
+ function userVerificationOf(named, fallback) {
1861
+ return named === "required" || named === "preferred" || named === "discouraged" ? named : fallback;
1862
1862
  }
1863
1863
  function promptFailure(error) {
1864
1864
  const e = error;
@@ -2245,10 +2245,13 @@ var CalimeroClient = class _CalimeroClient {
2245
2245
  origin
2246
2246
  );
2247
2247
  const registration = await passkey.create(begin.options);
2248
- const session = await this.postConfirmed(
2248
+ const session = await this.confirmed(
2249
+ "POST",
2249
2250
  "auth/passkey/register/finish",
2250
2251
  { challengeId: begin.challengeId, registration, ...invite },
2251
- passkey
2252
+ passkey,
2253
+ void 0,
2254
+ "preferred"
2252
2255
  );
2253
2256
  this.useSession(session);
2254
2257
  return session;
@@ -2639,7 +2642,7 @@ var CalimeroClient = class _CalimeroClient {
2639
2642
  deleteConfirmed(path, passkey, body = {}) {
2640
2643
  return this.confirmed("DELETE", path, body, passkey);
2641
2644
  }
2642
- async confirmed(method, path, body, passkey, send = (b) => this.json(method, path, b)) {
2645
+ async confirmed(method, path, body, passkey, send = (b) => this.json(method, path, b), userVerification = "required") {
2643
2646
  try {
2644
2647
  return await send(body);
2645
2648
  } catch (error) {
@@ -2648,7 +2651,7 @@ var CalimeroClient = class _CalimeroClient {
2648
2651
  let assertion;
2649
2652
  try {
2650
2653
  assertion = await passkey.get(fromB64url(d.challenge), d.rpId, d.allowCredentials, {
2651
- userVerification: userVerificationOf(d.userVerification)
2654
+ userVerification: userVerificationOf(d.userVerification, userVerification)
2652
2655
  });
2653
2656
  } catch (declined) {
2654
2657
  throw promptFailure(declined);