@cedros/login-react 0.0.26 → 0.0.28

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 CHANGED
@@ -12,8 +12,8 @@ import { b as Js, v as Ot } from "./validation-B8kMV3BL.js";
12
12
  import { E as ee } from "./ErrorMessage-CcEK0pYO.js";
13
13
  import { G as Xs } from "./GoogleLoginButton-B6qnNMZp.js";
14
14
  import { u as Qc } from "./GoogleLoginButton-B6qnNMZp.js";
15
- import { S as Zs } from "./mobileWalletAdapter-DMWmo9II.js";
16
- import { r as Yc, u as Gc } from "./mobileWalletAdapter-DMWmo9II.js";
15
+ import { S as Zs } from "./mobileWalletAdapter-Ds4-7Snb.js";
16
+ import { r as Yc, u as Gc } from "./mobileWalletAdapter-Ds4-7Snb.js";
17
17
  import { c as eo, d as to, u as ro, a as so, M as oo, I as no, b as ao, P as io } from "./PermissionsSection-CighC1p6.js";
18
18
  import { u as co } from "./useSystemSettings-DBlAMjFi.js";
19
19
  import { C as lo, S as Gr, a as uo, u as ho, A as po } from "./AutosaveStatus-vkJxtuEw.js";
@@ -3125,39 +3125,39 @@ function dn() {
3125
3125
  a(!0), n(null);
3126
3126
  try {
3127
3127
  const w = await l.post(
3128
- "/webauthn/auth/options",
3128
+ "/webauthn/signup/options",
3129
3129
  {}
3130
- ), m = er(w.options), u = await navigator.credentials.get({
3130
+ ), m = ct(w.options), u = await navigator.credentials.create({
3131
3131
  publicKey: m
3132
3132
  });
3133
3133
  if (!u)
3134
- throw new Error("Passkey authentication returned no credential");
3135
- const y = await l.post("/webauthn/auth/verify", {
3134
+ throw new Error("Passkey signup returned no credential");
3135
+ const y = await l.post("/webauthn/signup/verify", {
3136
3136
  challengeId: w.challengeId,
3137
3137
  credential: Te(u)
3138
3138
  });
3139
3139
  return t.callbacks?.onLoginSuccess?.(y.user, "webauthn"), r?.handleLoginSuccess(y.user, y.tokens), y;
3140
3140
  } catch (w) {
3141
- if (w instanceof Error && w.name === "NotAllowedError")
3141
+ if (w instanceof Error && w.name === "InvalidStateError")
3142
3142
  try {
3143
3143
  const y = await l.post(
3144
- "/webauthn/signup/options",
3144
+ "/webauthn/auth/options",
3145
3145
  {}
3146
- ), A = ct(y.options), b = await navigator.credentials.create({
3146
+ ), A = er(y.options), b = await navigator.credentials.get({
3147
3147
  publicKey: A
3148
3148
  });
3149
3149
  if (!b)
3150
- throw new Error("Passkey signup returned no credential");
3151
- const N = await l.post("/webauthn/signup/verify", {
3150
+ throw new Error("Passkey authentication returned no credential");
3151
+ const N = await l.post("/webauthn/auth/verify", {
3152
3152
  challengeId: y.challengeId,
3153
3153
  credential: Te(b)
3154
3154
  });
3155
3155
  return t.callbacks?.onLoginSuccess?.(N.user, "webauthn"), r?.handleLoginSuccess(N.user, N.tokens), N;
3156
3156
  } catch (y) {
3157
- const b = Be(y) ?? O(y, "Passkey sign-up failed");
3157
+ const b = Be(y) ?? O(y, "Passkey sign-in failed");
3158
3158
  throw n(b), b;
3159
3159
  }
3160
- const u = Be(w) ?? O(w, "Passkey sign-in failed");
3160
+ const u = Be(w) ?? O(w, "Passkey sign-up failed");
3161
3161
  throw n(u), u;
3162
3162
  } finally {
3163
3163
  a(!1);