cauthy-auth 0.24.2 → 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 +16 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +16 -4
- 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.mjs
CHANGED
|
@@ -147,6 +147,13 @@ function checkName(value) {
|
|
|
147
147
|
if (typeof value !== "string" || value.trim().length > MAX_NAME) return { field: "name", code: "too_long", message: `Use at most ${MAX_NAME} characters.` };
|
|
148
148
|
return null;
|
|
149
149
|
}
|
|
150
|
+
var MAX_ORGANIZATION = 120;
|
|
151
|
+
function checkOrganization(value, required = false) {
|
|
152
|
+
const v = typeof value === "string" ? value.trim() : "";
|
|
153
|
+
if (v === "") return required ? { field: "organization", code: "required", message: "Enter your company's name." } : null;
|
|
154
|
+
if (v.length > MAX_ORGANIZATION) return { field: "organization", code: "too_long", message: `Use at most ${MAX_ORGANIZATION} characters.` };
|
|
155
|
+
return null;
|
|
156
|
+
}
|
|
150
157
|
function checkCode(value) {
|
|
151
158
|
const v = typeof value === "string" ? value.trim() : "";
|
|
152
159
|
if (v === "") return { field: "code", code: "required", message: "Enter the code." };
|
|
@@ -369,7 +376,12 @@ function createAuthClient(options = {}) {
|
|
|
369
376
|
}
|
|
370
377
|
},
|
|
371
378
|
signUp: {
|
|
372
|
-
email: (f) => post(
|
|
379
|
+
email: (f) => post(
|
|
380
|
+
"/sign-up/email",
|
|
381
|
+
{ email: f.email, password: f.password, name: f.name, organization: f.organization },
|
|
382
|
+
firstProblem(checkName(f.name), checkEmail(f.email), checkNewPassword(f.password), checkOrganization(f.organization)),
|
|
383
|
+
f.captchaToken
|
|
384
|
+
)
|
|
373
385
|
},
|
|
374
386
|
forgotPassword: (f) => post("/forgot-password", { email: f.email }, checkEmail(f.email), f.captchaToken),
|
|
375
387
|
resetPassword: (f) => post("/reset-password", { token: f.token, password: f.password }, checkNewPassword(f.password)),
|