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/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
@@ -404,7 +404,7 @@ function createAuthClient(options = {}) {
404
404
  signUp: {
405
405
  email: (f) => post(
406
406
  "/sign-up/email",
407
- { 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 },
408
408
  firstProblem(checkName(f.name), checkEmail(f.email), checkNewPassword(f.password), checkOrganization(f.organization)),
409
409
  f.captchaToken
410
410
  )
@@ -437,6 +437,12 @@ function createAuthClient(options = {}) {
437
437
  return body && typeof body.account === "object" ? body.account : null;
438
438
  },
439
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),
440
446
  changePassword: (f) => {
441
447
  const bad = checkNewPassword(f.newPassword);
442
448
  return post("/me/password", { password: f.password, newPassword: f.newPassword }, bad ? { ...bad, field: "newPassword" } : null);