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/styles.css CHANGED
@@ -224,6 +224,20 @@
224
224
  border-radius: var(--cauthy-radius);
225
225
  }
226
226
 
227
+ /* A checkbox with its sentence: the terms accepted, a consent given. */
228
+ :where([data-cauthy] .cauthy-check) {
229
+ display: flex;
230
+ gap: 8px;
231
+ align-items: flex-start;
232
+ margin: 0 0 12px;
233
+ font-size: 13px;
234
+ line-height: 1.45;
235
+ color: var(--cauthy-text-muted);
236
+ }
237
+ :where([data-cauthy] .cauthy-check input) {
238
+ margin-top: 3px;
239
+ }
240
+
227
241
  :where([data-cauthy] .cauthy-footer) {
228
242
  margin: 4px 0 0;
229
243
  font-size: 13px;
package/dist/svelte.js CHANGED
@@ -285,6 +285,7 @@ function createAuthClient(options = {}) {
285
285
  mfa: (f) => post("/sign-in/mfa", { code: f.code }, checkCode(f.code)),
286
286
  mfaMethods: () => post("/sign-in/mfa/methods", {}, null),
287
287
  mfaSendCode: () => post("/sign-in/mfa/send", {}, null),
288
+ mfaSendEmail: () => post("/sign-in/mfa/email", {}, null),
288
289
  mfaPush: () => post("/sign-in/mfa/push", {}, null),
289
290
  async mfaPushWait(o = {}) {
290
291
  const status = await new Promise((resolve) => {
@@ -403,7 +404,7 @@ function createAuthClient(options = {}) {
403
404
  signUp: {
404
405
  email: (f) => post(
405
406
  "/sign-up/email",
406
- { email: f.email, password: f.password, name: f.name, organization: f.organization },
407
+ { email: f.email, password: f.password, name: f.name, organization: f.organization, acceptLegal: f.acceptLegal, consents: f.consents },
407
408
  firstProblem(checkName(f.name), checkEmail(f.email), checkNewPassword(f.password), checkOrganization(f.organization)),
408
409
  f.captchaToken
409
410
  )
@@ -436,6 +437,12 @@ function createAuthClient(options = {}) {
436
437
  return body && typeof body.account === "object" ? body.account : null;
437
438
  },
438
439
  update: (f) => post("/me", { name: f.name }, checkName(f.name)),
440
+ async legal() {
441
+ const body = await read("/me/legal");
442
+ if (!body) return { ok: false, error: { code: "not_signed_in", message: "Nobody is signed in." } };
443
+ return { ok: true, status: "ok", pending: Array.isArray(body.pending) ? body.pending : [] };
444
+ },
445
+ acceptLegal: (f = {}) => post("/me/legal/accept", { kinds: f.kinds ?? [] }, null),
439
446
  changePassword: (f) => {
440
447
  const bad = checkNewPassword(f.newPassword);
441
448
  return post("/me/password", { password: f.password, newPassword: f.newPassword }, bad ? { ...bad, field: "newPassword" } : null);