cauthy-auth 0.24.3 → 0.25.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/client.d.mts +12 -3
- package/dist/client.d.ts +12 -3
- package/dist/client.js +13 -1
- package/dist/client.js.map +1 -1
- package/dist/client.mjs +13 -1
- package/dist/client.mjs.map +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +13 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +13 -2
- package/dist/index.mjs.map +1 -1
- package/dist/react.d.mts +13 -2
- package/dist/react.d.ts +13 -2
- package/dist/react.js +23 -5
- package/dist/react.js.map +1 -1
- package/dist/react.mjs +23 -5
- package/dist/react.mjs.map +1 -1
- package/dist/svelte.d.mts +1 -1
- package/dist/svelte.d.ts +1 -1
- package/dist/svelte.js +13 -1
- package/dist/svelte.js.map +1 -1
- package/dist/svelte.mjs +13 -1
- package/dist/svelte.mjs.map +1 -1
- package/dist/{validate-B_iC-4y8.d.mts → validate-BTRit1O1.d.mts} +1 -1
- package/dist/{validate-B_iC-4y8.d.ts → validate-BTRit1O1.d.ts} +1 -1
- package/dist/vue.d.mts +1 -1
- package/dist/vue.d.ts +1 -1
- package/dist/vue.js +13 -1
- package/dist/vue.js.map +1 -1
- package/dist/vue.mjs +13 -1
- package/dist/vue.mjs.map +1 -1
- package/package.json +1 -1
package/dist/vue.d.mts
CHANGED
|
@@ -4,7 +4,7 @@ export { Account, AccountSession, AuthError, AuthMethods, AuthResult, Passkey, P
|
|
|
4
4
|
import { i as PublicSession } from './system-BxMsSIu1.mjs';
|
|
5
5
|
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';
|
|
6
6
|
import './theme.mjs';
|
|
7
|
-
import './validate-
|
|
7
|
+
import './validate-BTRit1O1.mjs';
|
|
8
8
|
import 'jose';
|
|
9
9
|
|
|
10
10
|
interface CauthyVueSession extends Pick<SessionStore, 'refresh' | 'signIn' | 'signOut' | 'accountUrl' | 'basePath'> {
|
package/dist/vue.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ export { Account, AccountSession, AuthError, AuthMethods, AuthResult, Passkey, P
|
|
|
4
4
|
import { i as PublicSession } from './system-DTIeDXDP.js';
|
|
5
5
|
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';
|
|
6
6
|
import './theme.js';
|
|
7
|
-
import './validate-
|
|
7
|
+
import './validate-BTRit1O1.js';
|
|
8
8
|
import 'jose';
|
|
9
9
|
|
|
10
10
|
interface CauthyVueSession extends Pick<SessionStore, 'refresh' | 'signIn' | 'signOut' | 'accountUrl' | 'basePath'> {
|
package/dist/vue.js
CHANGED
|
@@ -175,6 +175,13 @@ function checkName(value) {
|
|
|
175
175
|
if (typeof value !== "string" || value.trim().length > MAX_NAME) return { field: "name", code: "too_long", message: `Use at most ${MAX_NAME} characters.` };
|
|
176
176
|
return null;
|
|
177
177
|
}
|
|
178
|
+
var MAX_ORGANIZATION = 120;
|
|
179
|
+
function checkOrganization(value, required = false) {
|
|
180
|
+
const v = typeof value === "string" ? value.trim() : "";
|
|
181
|
+
if (v === "") return required ? { field: "organization", code: "required", message: "Enter your company's name." } : null;
|
|
182
|
+
if (v.length > MAX_ORGANIZATION) return { field: "organization", code: "too_long", message: `Use at most ${MAX_ORGANIZATION} characters.` };
|
|
183
|
+
return null;
|
|
184
|
+
}
|
|
178
185
|
function checkCode(value) {
|
|
179
186
|
const v = typeof value === "string" ? value.trim() : "";
|
|
180
187
|
if (v === "") return { field: "code", code: "required", message: "Enter the code." };
|
|
@@ -397,7 +404,12 @@ function createAuthClient(options = {}) {
|
|
|
397
404
|
}
|
|
398
405
|
},
|
|
399
406
|
signUp: {
|
|
400
|
-
email: (f) => post(
|
|
407
|
+
email: (f) => post(
|
|
408
|
+
"/sign-up/email",
|
|
409
|
+
{ email: f.email, password: f.password, name: f.name, organization: f.organization },
|
|
410
|
+
firstProblem(checkName(f.name), checkEmail(f.email), checkNewPassword(f.password), checkOrganization(f.organization)),
|
|
411
|
+
f.captchaToken
|
|
412
|
+
)
|
|
401
413
|
},
|
|
402
414
|
forgotPassword: (f) => post("/forgot-password", { email: f.email }, checkEmail(f.email), f.captchaToken),
|
|
403
415
|
resetPassword: (f) => post("/reset-password", { token: f.token, password: f.password }, checkNewPassword(f.password)),
|