@absolutejs/auth 0.81.0 → 0.83.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/CHANGELOG.md +16 -0
- package/README.md +14 -2
- package/changelog.json +37 -2
- package/dist/bun.d.ts +6 -0
- package/dist/bun.js +18078 -0
- package/dist/bun.js.map +140 -0
- package/dist/credentials/integration.d.ts +1 -1
- package/dist/index.d.ts +17 -16
- package/dist/index.js +13 -3
- package/dist/index.js.map +4 -4
- package/dist/manifest.js +9 -5
- package/dist/manifest.js.map +3 -3
- package/dist/oidc/routes.d.ts +16 -16
- package/dist/routes/signout.d.ts +192 -1
- package/dist/server.d.ts +1 -0
- package/dist/server.js +13 -3
- package/dist/server.js.map +5 -5
- package/docs/PERSISTENT-CREDENTIALS.md +22 -15
- package/package.json +8 -3
|
@@ -12,7 +12,8 @@ The application owns user records. The auth package owns credentials and session
|
|
|
12
12
|
|
|
13
13
|
```ts
|
|
14
14
|
import { auth } from '@absolutejs/auth/server';
|
|
15
|
-
import {
|
|
15
|
+
import { runBunMigrations } from '@absolutejs/auth/bun';
|
|
16
|
+
import { createPostgresAuthSessionStore, createPostgresCredentialStore } from '@absolutejs/auth';
|
|
16
17
|
import { SQL } from 'bun';
|
|
17
18
|
import { Database } from 'bun:sqlite';
|
|
18
19
|
import { drizzle } from 'drizzle-orm/bun-sql';
|
|
@@ -25,20 +26,11 @@ if (!databaseUrl)
|
|
|
25
26
|
throw new Error(
|
|
26
27
|
"AUTH_DATABASE_URL must point to the isolated acceptance database",
|
|
27
28
|
);
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
query: async (text, values) => ({
|
|
34
|
-
rows: await migrationClient.unsafe(text, values ? [...values] : []),
|
|
35
|
-
}),
|
|
36
|
-
},
|
|
37
|
-
log: () => undefined,
|
|
38
|
-
});
|
|
39
|
-
} finally {
|
|
40
|
-
await migrationClient.close();
|
|
41
|
-
}
|
|
29
|
+
await runBunMigrations({
|
|
30
|
+
databaseUrl,
|
|
31
|
+
blocks: ['sessions', 'credentials'],
|
|
32
|
+
log: () => undefined,
|
|
33
|
+
});
|
|
42
34
|
const authDb = drizzle({ client: new SQL(databaseUrl) });
|
|
43
35
|
const decodeCustomer = (value: unknown): Customer => {
|
|
44
36
|
if (typeof value !== "object" || value === null)
|
|
@@ -129,3 +121,18 @@ when absent, and scope database access to that user. Export the narrow business
|
|
|
129
121
|
subapp type for its own Eden client inside React Query. A compiler pass is
|
|
130
122
|
necessary, but real signup, login, reset, authorization and persistence tests
|
|
131
123
|
are still required.
|
|
124
|
+
|
|
125
|
+
## Typed sign-out (0.82.0+)
|
|
126
|
+
|
|
127
|
+
For a credentials-only application, mount `createSignoutApi({ authSessionStore })`
|
|
128
|
+
from `@absolutejs/auth/server` alongside `createCredentialsApi`. This provides
|
|
129
|
+
DELETE `/oauth2/signout` with the package's existing revocation and cookie policy.
|
|
130
|
+
Export that narrow subapp and call `treaty<typeof sessionApi>(origin).oauth2.signout.delete()`
|
|
131
|
+
inside a React Query mutation. Check errors before clearing client state. Do not
|
|
132
|
+
create a raw fetch fallback or a forwarding endpoint. When also mounting full
|
|
133
|
+
`auth` for OAuth, its default sign-out path is already present; do not register
|
|
134
|
+
duplicate sign-out handlers with different stores or hooks.
|
|
135
|
+
|
|
136
|
+
Elysia 2 business routes with request schemas use
|
|
137
|
+
`.post('/api/bookings', { body: t.Object({ classId: t.String() }) }, ({ body }) => ...)`.
|
|
138
|
+
The schema/options argument precedes the handler.
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.
|
|
2
|
+
"version": "0.83.0",
|
|
3
3
|
"name": "@absolutejs/auth",
|
|
4
4
|
"description": "An authorization library for absolutejs",
|
|
5
5
|
"repository": {
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"license": "BSL-1.1",
|
|
18
18
|
"author": "Alex Kahn",
|
|
19
19
|
"scripts": {
|
|
20
|
-
"build": "rm -rf dist && bun build src/index.ts src/server.ts src/agents/index.ts src/oidc/index.ts src/saml.ts src/webauthn.ts src/htmx/index.ts src/client/index.ts src/client/mobile.ts src/client/react.ts src/client/vue.ts src/client/solid.ts src/client/svelte.ts src/plugins/index.ts src/providers/index.ts src/linkedProviders/index.ts src/vault/index.ts src/manifest.ts --root src --outdir dist --sourcemap --target=bun --external elysia --external react --external vue --external solid-js --external svelte --external @opentelemetry/api --external @simplewebauthn/browser --external @simplewebauthn/server --external @node-saml/node-saml && bun build src/cli/migrate.ts --outdir dist/cli --sourcemap --target=bun --external @neondatabase/serverless --external drizzle-orm && bun build src/fingerprint-client/index.ts --outdir dist/fingerprint-client --sourcemap --target=browser && bun run scripts/emitDeclarations.ts && chmod +x dist/cli/migrate.js && absolute-manifest emit",
|
|
20
|
+
"build": "rm -rf dist && bun build src/bun.ts src/index.ts src/server.ts src/agents/index.ts src/oidc/index.ts src/saml.ts src/webauthn.ts src/htmx/index.ts src/client/index.ts src/client/mobile.ts src/client/react.ts src/client/vue.ts src/client/solid.ts src/client/svelte.ts src/plugins/index.ts src/providers/index.ts src/linkedProviders/index.ts src/vault/index.ts src/manifest.ts --root src --outdir dist --sourcemap --target=bun --external elysia --external react --external vue --external solid-js --external svelte --external @opentelemetry/api --external @simplewebauthn/browser --external @simplewebauthn/server --external @node-saml/node-saml && bun build src/cli/migrate.ts --outdir dist/cli --sourcemap --target=bun --external @neondatabase/serverless --external drizzle-orm && bun build src/fingerprint-client/index.ts --outdir dist/fingerprint-client --sourcemap --target=browser && bun run scripts/emitDeclarations.ts && chmod +x dist/cli/migrate.js && absolute-manifest emit",
|
|
21
21
|
"config": "absolute config",
|
|
22
22
|
"test": "bun test",
|
|
23
23
|
"format": "absolute prettier --write",
|
|
@@ -201,7 +201,12 @@
|
|
|
201
201
|
"import": "./dist/manifest.js",
|
|
202
202
|
"default": "./dist/manifest.js"
|
|
203
203
|
},
|
|
204
|
-
"./manifest.json": "./dist/manifest.json"
|
|
204
|
+
"./manifest.json": "./dist/manifest.json",
|
|
205
|
+
"./bun": {
|
|
206
|
+
"types": "./dist/bun.d.ts",
|
|
207
|
+
"import": "./dist/bun.js",
|
|
208
|
+
"require": "./dist/bun.js"
|
|
209
|
+
}
|
|
205
210
|
},
|
|
206
211
|
"type": "module",
|
|
207
212
|
"files": [
|