cauthy-auth 0.25.0 → 0.27.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/vue.js CHANGED
@@ -288,6 +288,7 @@ function createAuthClient(options = {}) {
288
288
  mfa: (f) => post("/sign-in/mfa", { code: f.code }, checkCode(f.code)),
289
289
  mfaMethods: () => post("/sign-in/mfa/methods", {}, null),
290
290
  mfaSendCode: () => post("/sign-in/mfa/send", {}, null),
291
+ mfaSendEmail: () => post("/sign-in/mfa/email", {}, null),
291
292
  mfaPush: () => post("/sign-in/mfa/push", {}, null),
292
293
  async mfaPushWait(o = {}) {
293
294
  const status = await new Promise((resolve) => {
@@ -406,7 +407,7 @@ function createAuthClient(options = {}) {
406
407
  signUp: {
407
408
  email: (f) => post(
408
409
  "/sign-up/email",
409
- { email: f.email, password: f.password, name: f.name, organization: f.organization },
410
+ { email: f.email, password: f.password, name: f.name, organization: f.organization, acceptLegal: f.acceptLegal, consents: f.consents },
410
411
  firstProblem(checkName(f.name), checkEmail(f.email), checkNewPassword(f.password), checkOrganization(f.organization)),
411
412
  f.captchaToken
412
413
  )
@@ -439,6 +440,12 @@ function createAuthClient(options = {}) {
439
440
  return body && typeof body.account === "object" ? body.account : null;
440
441
  },
441
442
  update: (f) => post("/me", { name: f.name }, checkName(f.name)),
443
+ async legal() {
444
+ const body = await read("/me/legal");
445
+ if (!body) return { ok: false, error: { code: "not_signed_in", message: "Nobody is signed in." } };
446
+ return { ok: true, status: "ok", pending: Array.isArray(body.pending) ? body.pending : [] };
447
+ },
448
+ acceptLegal: (f = {}) => post("/me/legal/accept", { kinds: f.kinds ?? [] }, null),
442
449
  changePassword: (f) => {
443
450
  const bad = checkNewPassword(f.newPassword);
444
451
  return post("/me/password", { password: f.password, newPassword: f.newPassword }, bad ? { ...bad, field: "newPassword" } : null);