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.js CHANGED
@@ -407,7 +407,7 @@ function createAuthClient(options = {}) {
407
407
  signUp: {
408
408
  email: (f) => post(
409
409
  "/sign-up/email",
410
- { 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 },
411
411
  firstProblem(checkName(f.name), checkEmail(f.email), checkNewPassword(f.password), checkOrganization(f.organization)),
412
412
  f.captchaToken
413
413
  )
@@ -440,6 +440,12 @@ function createAuthClient(options = {}) {
440
440
  return body && typeof body.account === "object" ? body.account : null;
441
441
  },
442
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),
443
449
  changePassword: (f) => {
444
450
  const bad = checkNewPassword(f.newPassword);
445
451
  return post("/me/password", { password: f.password, newPassword: f.newPassword }, bad ? { ...bad, field: "newPassword" } : null);