cauthy-auth 0.26.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.mjs CHANGED
@@ -379,7 +379,7 @@ function createAuthClient(options = {}) {
379
379
  signUp: {
380
380
  email: (f) => post(
381
381
  "/sign-up/email",
382
- { email: f.email, password: f.password, name: f.name, organization: f.organization },
382
+ { email: f.email, password: f.password, name: f.name, organization: f.organization, acceptLegal: f.acceptLegal, consents: f.consents },
383
383
  firstProblem(checkName(f.name), checkEmail(f.email), checkNewPassword(f.password), checkOrganization(f.organization)),
384
384
  f.captchaToken
385
385
  )
@@ -412,6 +412,12 @@ function createAuthClient(options = {}) {
412
412
  return body && typeof body.account === "object" ? body.account : null;
413
413
  },
414
414
  update: (f) => post("/me", { name: f.name }, checkName(f.name)),
415
+ async legal() {
416
+ const body = await read("/me/legal");
417
+ if (!body) return { ok: false, error: { code: "not_signed_in", message: "Nobody is signed in." } };
418
+ return { ok: true, status: "ok", pending: Array.isArray(body.pending) ? body.pending : [] };
419
+ },
420
+ acceptLegal: (f = {}) => post("/me/legal/accept", { kinds: f.kinds ?? [] }, null),
415
421
  changePassword: (f) => {
416
422
  const bad = checkNewPassword(f.newPassword);
417
423
  return post("/me/password", { password: f.password, newPassword: f.newPassword }, bad ? { ...bad, field: "newPassword" } : null);