cauthy-auth 0.26.0 → 0.27.1
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/cli.js +3 -1
- package/dist/client.d.mts +45 -4
- package/dist/client.d.ts +45 -4
- package/dist/client.js +9 -3
- package/dist/client.js.map +1 -1
- package/dist/client.mjs +9 -3
- package/dist/client.mjs.map +1 -1
- package/dist/index.d.mts +7 -1
- package/dist/index.d.ts +7 -1
- package/dist/index.js +31 -6
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +31 -6
- package/dist/index.mjs.map +1 -1
- package/dist/react.d.mts +48 -2
- package/dist/react.d.ts +48 -2
- package/dist/react.js +49 -6
- package/dist/react.js.map +1 -1
- package/dist/react.mjs +49 -6
- package/dist/react.mjs.map +1 -1
- package/dist/styles.css +14 -0
- package/dist/svelte.d.mts +1 -1
- package/dist/svelte.d.ts +1 -1
- package/dist/svelte.js +9 -3
- package/dist/svelte.js.map +1 -1
- package/dist/svelte.mjs +9 -3
- package/dist/svelte.mjs.map +1 -1
- package/dist/{validate-BTRit1O1.d.mts → validate-YbEfIzfl.d.mts} +2 -2
- package/dist/{validate-BTRit1O1.d.ts → validate-YbEfIzfl.d.ts} +2 -2
- package/dist/vue.d.mts +1 -1
- package/dist/vue.d.ts +1 -1
- package/dist/vue.js +9 -3
- package/dist/vue.js.map +1 -1
- package/dist/vue.mjs +9 -3
- package/dist/vue.mjs.map +1 -1
- package/package.json +1 -1
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.d.mts
CHANGED
|
@@ -3,7 +3,7 @@ export { Account, AccountSession, AuthClient, AuthError, AuthMethods, AuthResult
|
|
|
3
3
|
import { i as PublicSession } from './system-BxMsSIu1.mjs';
|
|
4
4
|
export { P as PermissionOf, f as Policy, R as RoleOf, k as SessionOrganization, m as SessionUser, p as can, r as definePolicy } from './system-BxMsSIu1.mjs';
|
|
5
5
|
import './theme.mjs';
|
|
6
|
-
import './validate-
|
|
6
|
+
import './validate-YbEfIzfl.mjs';
|
|
7
7
|
import 'jose';
|
|
8
8
|
|
|
9
9
|
/** A value Svelte can read with `$`: its store contract. */
|
package/dist/svelte.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ export { Account, AccountSession, AuthClient, AuthError, AuthMethods, AuthResult
|
|
|
3
3
|
import { i as PublicSession } from './system-DTIeDXDP.js';
|
|
4
4
|
export { P as PermissionOf, f as Policy, R as RoleOf, k as SessionOrganization, m as SessionUser, p as can, r as definePolicy } from './system-DTIeDXDP.js';
|
|
5
5
|
import './theme.js';
|
|
6
|
-
import './validate-
|
|
6
|
+
import './validate-YbEfIzfl.js';
|
|
7
7
|
import 'jose';
|
|
8
8
|
|
|
9
9
|
/** A value Svelte can read with `$`: its store contract. */
|
package/dist/svelte.js
CHANGED
|
@@ -144,8 +144,8 @@ function fromWire(wire) {
|
|
|
144
144
|
}
|
|
145
145
|
|
|
146
146
|
// src/validate.ts
|
|
147
|
-
var MIN_PASSWORD =
|
|
148
|
-
var MAX_PASSWORD =
|
|
147
|
+
var MIN_PASSWORD = 12;
|
|
148
|
+
var MAX_PASSWORD = 128;
|
|
149
149
|
var MAX_NAME = 120;
|
|
150
150
|
var EMAIL = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
|
|
151
151
|
function checkEmail(value) {
|
|
@@ -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);
|