cauthy-auth 0.24.3 → 0.26.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 +36 -7
- package/dist/client.d.ts +36 -7
- package/dist/client.js +14 -1
- package/dist/client.js.map +1 -1
- package/dist/client.mjs +14 -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 +25 -5
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +25 -5
- package/dist/index.mjs.map +1 -1
- package/dist/react.d.mts +40 -6
- package/dist/react.d.ts +40 -6
- package/dist/react.js +39 -7
- package/dist/react.js.map +1 -1
- package/dist/react.mjs +39 -7
- 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 +14 -1
- package/dist/svelte.js.map +1 -1
- package/dist/svelte.mjs +14 -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 +14 -1
- package/dist/vue.js.map +1 -1
- package/dist/vue.mjs +14 -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." };
|
|
@@ -281,6 +288,7 @@ function createAuthClient(options = {}) {
|
|
|
281
288
|
mfa: (f) => post("/sign-in/mfa", { code: f.code }, checkCode(f.code)),
|
|
282
289
|
mfaMethods: () => post("/sign-in/mfa/methods", {}, null),
|
|
283
290
|
mfaSendCode: () => post("/sign-in/mfa/send", {}, null),
|
|
291
|
+
mfaSendEmail: () => post("/sign-in/mfa/email", {}, null),
|
|
284
292
|
mfaPush: () => post("/sign-in/mfa/push", {}, null),
|
|
285
293
|
async mfaPushWait(o = {}) {
|
|
286
294
|
const status = await new Promise((resolve) => {
|
|
@@ -397,7 +405,12 @@ function createAuthClient(options = {}) {
|
|
|
397
405
|
}
|
|
398
406
|
},
|
|
399
407
|
signUp: {
|
|
400
|
-
email: (f) => post(
|
|
408
|
+
email: (f) => post(
|
|
409
|
+
"/sign-up/email",
|
|
410
|
+
{ email: f.email, password: f.password, name: f.name, organization: f.organization },
|
|
411
|
+
firstProblem(checkName(f.name), checkEmail(f.email), checkNewPassword(f.password), checkOrganization(f.organization)),
|
|
412
|
+
f.captchaToken
|
|
413
|
+
)
|
|
401
414
|
},
|
|
402
415
|
forgotPassword: (f) => post("/forgot-password", { email: f.email }, checkEmail(f.email), f.captchaToken),
|
|
403
416
|
resetPassword: (f) => post("/reset-password", { token: f.token, password: f.password }, checkNewPassword(f.password)),
|