cauthy-auth 0.25.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/client.d.mts +67 -6
- package/dist/client.d.ts +67 -6
- package/dist/client.js +8 -1
- package/dist/client.js.map +1 -1
- package/dist/client.mjs +8 -1
- package/dist/client.mjs.map +1 -1
- package/dist/index.js +38 -6
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +38 -6
- package/dist/index.mjs.map +1 -1
- package/dist/react.d.mts +75 -6
- package/dist/react.d.ts +75 -6
- package/dist/react.js +61 -4
- package/dist/react.js.map +1 -1
- package/dist/react.mjs +61 -4
- package/dist/react.mjs.map +1 -1
- package/dist/styles.css +14 -0
- package/dist/svelte.js +8 -1
- package/dist/svelte.js.map +1 -1
- package/dist/svelte.mjs +8 -1
- package/dist/svelte.mjs.map +1 -1
- package/dist/vue.js +8 -1
- package/dist/vue.js.map +1 -1
- package/dist/vue.mjs +8 -1
- package/dist/vue.mjs.map +1 -1
- package/package.json +1 -1
package/dist/vue.mjs
CHANGED
|
@@ -260,6 +260,7 @@ function createAuthClient(options = {}) {
|
|
|
260
260
|
mfa: (f) => post("/sign-in/mfa", { code: f.code }, checkCode(f.code)),
|
|
261
261
|
mfaMethods: () => post("/sign-in/mfa/methods", {}, null),
|
|
262
262
|
mfaSendCode: () => post("/sign-in/mfa/send", {}, null),
|
|
263
|
+
mfaSendEmail: () => post("/sign-in/mfa/email", {}, null),
|
|
263
264
|
mfaPush: () => post("/sign-in/mfa/push", {}, null),
|
|
264
265
|
async mfaPushWait(o = {}) {
|
|
265
266
|
const status = await new Promise((resolve) => {
|
|
@@ -378,7 +379,7 @@ function createAuthClient(options = {}) {
|
|
|
378
379
|
signUp: {
|
|
379
380
|
email: (f) => post(
|
|
380
381
|
"/sign-up/email",
|
|
381
|
-
{ email: f.email, password: f.password, name: f.name, organization: f.organization },
|
|
382
|
+
{ email: f.email, password: f.password, name: f.name, organization: f.organization, acceptLegal: f.acceptLegal, consents: f.consents },
|
|
382
383
|
firstProblem(checkName(f.name), checkEmail(f.email), checkNewPassword(f.password), checkOrganization(f.organization)),
|
|
383
384
|
f.captchaToken
|
|
384
385
|
)
|
|
@@ -411,6 +412,12 @@ function createAuthClient(options = {}) {
|
|
|
411
412
|
return body && typeof body.account === "object" ? body.account : null;
|
|
412
413
|
},
|
|
413
414
|
update: (f) => post("/me", { name: f.name }, checkName(f.name)),
|
|
415
|
+
async legal() {
|
|
416
|
+
const body = await read("/me/legal");
|
|
417
|
+
if (!body) return { ok: false, error: { code: "not_signed_in", message: "Nobody is signed in." } };
|
|
418
|
+
return { ok: true, status: "ok", pending: Array.isArray(body.pending) ? body.pending : [] };
|
|
419
|
+
},
|
|
420
|
+
acceptLegal: (f = {}) => post("/me/legal/accept", { kinds: f.kinds ?? [] }, null),
|
|
414
421
|
changePassword: (f) => {
|
|
415
422
|
const bad = checkNewPassword(f.newPassword);
|
|
416
423
|
return post("/me/password", { password: f.password, newPassword: f.newPassword }, bad ? { ...bad, field: "newPassword" } : null);
|