cauthy-auth 0.30.0 → 0.31.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/README.md +10 -3
- package/dist/{cauthy-BXgsZ-Um.d.mts → cauthy-2jtP2LVQ.d.mts} +1 -1
- package/dist/{cauthy-CHENs452.d.ts → cauthy-CKfvvv_i.d.ts} +1 -1
- package/dist/cli.js +8 -5
- package/dist/client.d.mts +47 -6
- package/dist/client.d.ts +47 -6
- package/dist/client.js +16 -2
- package/dist/client.js.map +1 -1
- package/dist/client.mjs +16 -2
- package/dist/client.mjs.map +1 -1
- package/dist/express.d.mts +2 -2
- package/dist/express.d.ts +2 -2
- package/dist/fastify.d.mts +2 -2
- package/dist/fastify.d.ts +2 -2
- package/dist/hono.d.mts +2 -2
- package/dist/hono.d.ts +2 -2
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +64 -21
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +64 -21
- package/dist/index.mjs.map +1 -1
- package/dist/next.d.mts +2 -2
- package/dist/next.d.ts +2 -2
- package/dist/react.d.mts +61 -5
- package/dist/react.d.ts +61 -5
- package/dist/react.js +183 -46
- package/dist/react.js.map +1 -1
- package/dist/react.mjs +182 -46
- package/dist/react.mjs.map +1 -1
- package/dist/styles.css +8 -0
- package/dist/svelte.d.mts +2 -2
- package/dist/svelte.d.ts +2 -2
- package/dist/svelte.js +16 -2
- package/dist/svelte.js.map +1 -1
- package/dist/svelte.mjs +16 -2
- package/dist/svelte.mjs.map +1 -1
- package/dist/{system-0mHrdAgO.d.mts → system-BrrJsrFW.d.mts} +14 -0
- package/dist/{system-BIYbS7h2.d.ts → system-BvvoNs2y.d.ts} +14 -0
- package/dist/vue.d.mts +2 -2
- package/dist/vue.d.ts +2 -2
- package/dist/vue.js +16 -2
- package/dist/vue.js.map +1 -1
- package/dist/vue.mjs +16 -2
- package/dist/vue.mjs.map +1 -1
- package/package.json +1 -1
package/dist/styles.css
CHANGED
|
@@ -158,6 +158,14 @@
|
|
|
158
158
|
border: 1px solid var(--cauthy-input-border);
|
|
159
159
|
}
|
|
160
160
|
|
|
161
|
+
/* A provider's logo, before "Continue with …". */
|
|
162
|
+
:where([data-cauthy] .cauthy-providerIcon) {
|
|
163
|
+
flex: none;
|
|
164
|
+
width: 18px;
|
|
165
|
+
height: 18px;
|
|
166
|
+
object-fit: contain;
|
|
167
|
+
}
|
|
168
|
+
|
|
161
169
|
:where([data-cauthy] .cauthy-button:hover:not(:disabled)),
|
|
162
170
|
:where([data-cauthy] .cauthy-providerButton:hover:not(:disabled)) {
|
|
163
171
|
filter: brightness(0.94);
|
package/dist/svelte.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { SessionStore, SessionState, SessionStoreOptions } from './client.mjs';
|
|
2
2
|
export { Account, AccountSession, AuthClient, AuthError, AuthMethods, AuthResult, Passkey, PasskeyKind, SSOConnection } from './client.mjs';
|
|
3
|
-
import { q as PublicSession } from './system-
|
|
4
|
-
export { P as PermissionOf, m as Policy, R as RoleOf, s as SessionOrganization, u as SessionUser, y as can, B as definePolicy } from './system-
|
|
3
|
+
import { q as PublicSession } from './system-BrrJsrFW.mjs';
|
|
4
|
+
export { P as PermissionOf, m as Policy, R as RoleOf, s as SessionOrganization, u as SessionUser, y as can, B as definePolicy } from './system-BrrJsrFW.mjs';
|
|
5
5
|
import './theme.mjs';
|
|
6
6
|
import './validate-sEXG82po.mjs';
|
|
7
7
|
import 'jose';
|
package/dist/svelte.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { SessionStore, SessionState, SessionStoreOptions } from './client.js';
|
|
2
2
|
export { Account, AccountSession, AuthClient, AuthError, AuthMethods, AuthResult, Passkey, PasskeyKind, SSOConnection } from './client.js';
|
|
3
|
-
import { q as PublicSession } from './system-
|
|
4
|
-
export { P as PermissionOf, m as Policy, R as RoleOf, s as SessionOrganization, u as SessionUser, y as can, B as definePolicy } from './system-
|
|
3
|
+
import { q as PublicSession } from './system-BvvoNs2y.js';
|
|
4
|
+
export { P as PermissionOf, m as Policy, R as RoleOf, s as SessionOrganization, u as SessionUser, y as can, B as definePolicy } from './system-BvvoNs2y.js';
|
|
5
5
|
import './theme.js';
|
|
6
6
|
import './validate-sEXG82po.js';
|
|
7
7
|
import 'jose';
|
package/dist/svelte.js
CHANGED
|
@@ -372,11 +372,11 @@ function createAuthClient(options = {}) {
|
|
|
372
372
|
if (res.ok) {
|
|
373
373
|
const m = await res.json();
|
|
374
374
|
if (m.password) policy = passwordPolicyOf(m.password);
|
|
375
|
-
return { providers: [], signUp: true, magicLink: false, passkey: false, ...m, ...policy ? { password: policy } : {}, passkeyHere: m.passkeyHere === true, passkeyOnCauthy: m.passkeyOnCauthy ?? m.passkey === true, sso: m.sso === true };
|
|
375
|
+
return { providers: [], signUp: true, magicLink: false, passkey: false, ...m, ...policy ? { password: policy } : {}, passwordSignIn: m.passwordSignIn !== false, passkeyHere: m.passkeyHere === true, passkeyOnCauthy: m.passkeyOnCauthy ?? m.passkey === true, sso: m.sso === true };
|
|
376
376
|
}
|
|
377
377
|
} catch {
|
|
378
378
|
}
|
|
379
|
-
return { providers: [], signUp: true, magicLink: false, passkey: false, passkeyHere: false, passkeyOnCauthy: false, sso: false };
|
|
379
|
+
return { providers: [], signUp: true, passwordSignIn: true, magicLink: false, passkey: false, passkeyHere: false, passkeyOnCauthy: false, sso: false };
|
|
380
380
|
}
|
|
381
381
|
async function ceremony(begin, finish, form, run, more = {}) {
|
|
382
382
|
const begun = await post(begin, form, null);
|
|
@@ -523,6 +523,20 @@ function createAuthClient(options = {}) {
|
|
|
523
523
|
forgotPassword: (f) => post("/forgot-password", { email: f.email }, checkEmail(f.email), f.captchaToken),
|
|
524
524
|
resetPassword: (f) => post("/reset-password", { token: f.token, password: f.password }, checkNewPassword(f.password, policy)),
|
|
525
525
|
verifyEmail: (f) => post("/verify-email", { token: f.token }, null),
|
|
526
|
+
async invitation(token) {
|
|
527
|
+
const bad = { ok: false, error: { code: "invalid_token", message: "This invitation is not valid, or it has expired." } };
|
|
528
|
+
if (typeof token !== "string" || token.trim() === "") return bad;
|
|
529
|
+
try {
|
|
530
|
+
const res = await doFetch(`${base}/invitation?token=${encodeURIComponent(token.trim())}`, { credentials: "same-origin", headers: { accept: "application/json" } });
|
|
531
|
+
const body = await res.json().catch(() => null);
|
|
532
|
+
if (res.ok && body?.invitation) return { ok: true, status: "ok", invitation: body.invitation };
|
|
533
|
+
const e = body?.error;
|
|
534
|
+
return { ok: false, error: e && typeof e.code === "string" ? { code: e.code, message: String(e.message ?? "") } : UNAVAILABLE };
|
|
535
|
+
} catch {
|
|
536
|
+
return { ok: false, error: UNAVAILABLE };
|
|
537
|
+
}
|
|
538
|
+
},
|
|
539
|
+
acceptInvitation: (token, password) => post("/invitation/accept", { token, password }, checkNewPassword(password, policy)),
|
|
526
540
|
signOut: () => post("/sign-out", {}, null),
|
|
527
541
|
organizations: {
|
|
528
542
|
async list(system) {
|