@korajs/auth 1.0.0-beta.11 → 1.0.0-beta.13
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 +52 -47
- package/dist/{create-org-session-RsDj9cl4.d.cts → create-org-session-ChFdulEM.d.cts} +211 -17
- package/dist/{create-org-session-RsDj9cl4.d.ts → create-org-session-ChFdulEM.d.ts} +211 -17
- package/dist/index.cjs +645 -150
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +27 -9
- package/dist/index.d.ts +27 -9
- package/dist/index.js +644 -150
- package/dist/index.js.map +1 -1
- package/dist/{operation-encryptor-DRmKNWpF.d.cts → operation-encryptor-DDdlb9bm.d.cts} +16 -0
- package/dist/{operation-encryptor-DRmKNWpF.d.ts → operation-encryptor-DDdlb9bm.d.ts} +16 -0
- package/dist/react.d.cts +2 -2
- package/dist/react.d.ts +2 -2
- package/dist/server.cjs +2852 -1675
- package/dist/server.cjs.map +1 -1
- package/dist/server.d.cts +779 -168
- package/dist/server.d.ts +779 -168
- package/dist/server.js +2831 -1665
- package/dist/server.js.map +1 -1
- package/dist/svelte.cjs +2 -2
- package/dist/svelte.cjs.map +1 -1
- package/dist/svelte.d.cts +2 -2
- package/dist/svelte.d.ts +2 -2
- package/dist/svelte.js +2 -2
- package/dist/svelte.js.map +1 -1
- package/dist/vue.d.cts +1 -1
- package/dist/vue.d.ts +1 -1
- package/package.json +7 -7
- package/src/admin/admin-api.ts +327 -0
- package/src/admin/audit-log.ts +324 -0
- package/src/admin/webhooks.ts +576 -0
- package/src/bindings/create-auth-session.ts +184 -0
- package/src/bindings/create-org-session.ts +130 -0
- package/src/client/auth-client.ts +1592 -0
- package/src/client/auth-sync.ts +213 -0
- package/src/client/device-session.ts +104 -0
- package/src/client/org-client.ts +399 -0
- package/src/client/quickstart.ts +108 -0
- package/src/client/storage.ts +94 -0
- package/src/device/device-identity.ts +330 -0
- package/src/device/device-store.ts +379 -0
- package/src/encryption/auto-lock.ts +170 -0
- package/src/encryption/database-encryption.ts +265 -0
- package/src/encryption/key-derivation.ts +149 -0
- package/src/encryption/operation-encryptor.ts +361 -0
- package/src/index.ts +132 -0
- package/src/mfa/totp.ts +826 -0
- package/src/org/org-routes.ts +758 -0
- package/src/org/org-store.ts +490 -0
- package/src/org/org-types.ts +230 -0
- package/src/passkey/passkey-client.ts +597 -0
- package/src/passkey/passkey-server.ts +779 -0
- package/src/postgres/ensure-schema.ts +65 -0
- package/src/provider/adapter.ts +246 -0
- package/src/provider/built-in/auth-routes.ts +1313 -0
- package/src/provider/built-in/email-verification.ts +303 -0
- package/src/provider/built-in/password-hash.ts +118 -0
- package/src/provider/built-in/password-reset.ts +416 -0
- package/src/provider/built-in/postgres-user-store.ts +328 -0
- package/src/provider/built-in/quickstart-server.ts +760 -0
- package/src/provider/built-in/sqlite-user-store.ts +322 -0
- package/src/provider/built-in/sync-scopes.ts +85 -0
- package/src/provider/built-in/user-store.ts +465 -0
- package/src/provider/external/clerk-adapter.ts +157 -0
- package/src/provider/external/external-jwt-provider.ts +491 -0
- package/src/provider/external/supabase-adapter.ts +163 -0
- package/src/provider/oauth/linked-identity-store.ts +108 -0
- package/src/provider/oauth/oauth-flow.ts +550 -0
- package/src/provider/oauth/oauth-types.ts +184 -0
- package/src/provider/oauth/postgres-oauth-store.ts +296 -0
- package/src/provider/oauth/sqlite-oauth-store.ts +272 -0
- package/src/rbac/rbac-engine.ts +323 -0
- package/src/rbac/rbac-types.ts +210 -0
- package/src/rbac/scope-resolver.ts +140 -0
- package/src/react/AuthProvider.tsx +97 -0
- package/src/react/OrgProvider.tsx +41 -0
- package/src/react/auth-context.ts +26 -0
- package/src/react/hooks.ts +110 -0
- package/src/react/org-hooks.ts +214 -0
- package/src/react.ts +26 -0
- package/src/server.ts +334 -0
- package/src/session/session.ts +401 -0
- package/src/svelte/auth-context.ts +50 -0
- package/src/svelte/org-context.ts +32 -0
- package/src/svelte/org-hooks.ts +201 -0
- package/src/svelte/use-auth.ts +115 -0
- package/src/svelte.ts +25 -0
- package/src/tokens/encrypted-token-store.ts +360 -0
- package/src/tokens/jwt.ts +236 -0
- package/src/tokens/postgres-token-revocation-store.ts +140 -0
- package/src/tokens/sqlite-token-revocation-store.ts +121 -0
- package/src/tokens/token-manager.ts +821 -0
- package/src/tokens/token-store.ts +192 -0
- package/src/types.ts +394 -0
- package/src/vue/auth-context.ts +10 -0
- package/src/vue/auth-provider-types.ts +5 -0
- package/src/vue/auth-provider.ts +76 -0
- package/src/vue/org-hooks.ts +193 -0
- package/src/vue/org-provider.ts +49 -0
- package/src/vue/use-auth.ts +139 -0
- package/src/vue.ts +10 -0
|
@@ -35,6 +35,22 @@ interface TokenPayload {
|
|
|
35
35
|
iat: number;
|
|
36
36
|
/** Expiration time (seconds since epoch, per JWT spec) */
|
|
37
37
|
exp: number;
|
|
38
|
+
/**
|
|
39
|
+
* Refresh-token family id. Every token minted by one sign-in and its refresh
|
|
40
|
+
* rotations shares it, so reuse detection can revoke exactly that family
|
|
41
|
+
* instead of the whole device. Absent on tokens minted before beta.13.
|
|
42
|
+
*/
|
|
43
|
+
fam?: string;
|
|
44
|
+
/**
|
|
45
|
+
* Issue time in milliseconds. `iat` has one-second resolution, which is too
|
|
46
|
+
* coarse to order a token against a revocation made in the same second.
|
|
47
|
+
*/
|
|
48
|
+
iatMs?: number;
|
|
49
|
+
/**
|
|
50
|
+
* Authentication methods used to obtain this session (RFC 8176), for example
|
|
51
|
+
* `['pwd']` or `['pwd', 'otp']`.
|
|
52
|
+
*/
|
|
53
|
+
amr?: string[];
|
|
38
54
|
}
|
|
39
55
|
/**
|
|
40
56
|
* Bundle of tokens returned after successful authentication.
|
|
@@ -35,6 +35,22 @@ interface TokenPayload {
|
|
|
35
35
|
iat: number;
|
|
36
36
|
/** Expiration time (seconds since epoch, per JWT spec) */
|
|
37
37
|
exp: number;
|
|
38
|
+
/**
|
|
39
|
+
* Refresh-token family id. Every token minted by one sign-in and its refresh
|
|
40
|
+
* rotations shares it, so reuse detection can revoke exactly that family
|
|
41
|
+
* instead of the whole device. Absent on tokens minted before beta.13.
|
|
42
|
+
*/
|
|
43
|
+
fam?: string;
|
|
44
|
+
/**
|
|
45
|
+
* Issue time in milliseconds. `iat` has one-second resolution, which is too
|
|
46
|
+
* coarse to order a token against a revocation made in the same second.
|
|
47
|
+
*/
|
|
48
|
+
iatMs?: number;
|
|
49
|
+
/**
|
|
50
|
+
* Authentication methods used to obtain this session (RFC 8176), for example
|
|
51
|
+
* `['pwd']` or `['pwd', 'otp']`.
|
|
52
|
+
*/
|
|
53
|
+
amr?: string[];
|
|
38
54
|
}
|
|
39
55
|
/**
|
|
40
56
|
* Bundle of tokens returned after successful authentication.
|
package/dist/react.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import { ReactNode, ReactElement } from 'react';
|
|
3
|
-
import { d as AuthClient, e as AuthState$1,
|
|
4
|
-
export {
|
|
3
|
+
import { d as AuthClient, e as AuthState$1, n as AuthUser, O as OAuthAuthorizationOptions, s as OAuthAuthorizationResult, t as OAuthCallbackParams, L as LinkedOAuthAccount, j as AuthSession, u as OrgClient, x as OrgSession, o as ClientMembership, C as ClientInvitation, p as ClientOrganization } from './create-org-session-ChFdulEM.cjs';
|
|
4
|
+
export { z as checkOrgPermission } from './create-org-session-ChFdulEM.cjs';
|
|
5
5
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
6
6
|
import '@korajs/core';
|
|
7
7
|
|
package/dist/react.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import { ReactNode, ReactElement } from 'react';
|
|
3
|
-
import { d as AuthClient, e as AuthState$1,
|
|
4
|
-
export {
|
|
3
|
+
import { d as AuthClient, e as AuthState$1, n as AuthUser, O as OAuthAuthorizationOptions, s as OAuthAuthorizationResult, t as OAuthCallbackParams, L as LinkedOAuthAccount, j as AuthSession, u as OrgClient, x as OrgSession, o as ClientMembership, C as ClientInvitation, p as ClientOrganization } from './create-org-session-ChFdulEM.js';
|
|
4
|
+
export { z as checkOrgPermission } from './create-org-session-ChFdulEM.js';
|
|
5
5
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
6
6
|
import '@korajs/core';
|
|
7
7
|
|