@jxsuite/auth 0.4.0 → 0.4.2
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 +1 -1
- package/package.json +5 -5
- package/src/client.ts +5 -5
- package/src/server.ts +3 -4
package/README.md
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
## Overview
|
|
6
6
|
|
|
7
7
|
`@jxsuite/auth` is the Jx extension putting users behind the connector's data tables. It owns the
|
|
8
|
-
project.json `auth` section and mounts [Better Auth](https://better-auth.com)
|
|
8
|
+
project.json `auth` section and mounts [Better Auth](https://better-auth.com) at
|
|
9
9
|
`/_jx/auth` — **order 10**, ahead of the connector's `/_jx/data` mount (order 20) — publishing the
|
|
10
10
|
`ctx.auth = { getSession, authorize }` hooks on the shared server context
|
|
11
11
|
(specs/extensions.md §11). With this mount active, table permission rules beyond
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jxsuite/auth",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.2",
|
|
4
4
|
"description": "Better Auth sessions, sign-in flows, and table permissions for Jx sites over /_jx/auth",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -38,13 +38,13 @@
|
|
|
38
38
|
"upgrade": "bunx npm-check-updates -u && bun install"
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@jxsuite/connector": "^0.4.
|
|
42
|
-
"@jxsuite/schema": "^1.
|
|
43
|
-
"better-auth": "1.6.
|
|
41
|
+
"@jxsuite/connector": "^0.4.2",
|
|
42
|
+
"@jxsuite/schema": "^1.5.0",
|
|
43
|
+
"better-auth": "^1.6.25",
|
|
44
44
|
"kysely": "^0.29.4"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
|
-
"@happy-dom/global-registrator": "^20.11.
|
|
47
|
+
"@happy-dom/global-registrator": "^20.11.1",
|
|
48
48
|
"ajv": "^8.20.0"
|
|
49
49
|
},
|
|
50
50
|
"jx": "./jx-extension.json"
|
package/src/client.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Client — the browser-safe Better Auth client wrapper.
|
|
3
3
|
*
|
|
4
|
-
* Wraps `createAuthClient` from better-auth/client (
|
|
5
|
-
* `
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
4
|
+
* Wraps `createAuthClient` from better-auth/client (`signIn.email`, `signUp.email`,
|
|
5
|
+
* `signIn.social`, `signOut`, `getSession`, each returning `{ data, error }`) behind a module-level
|
|
6
|
+
* singleton pointed at the site's own /_jx/auth mount. Everything here is typed structurally
|
|
7
|
+
* against the narrow slice the session store and auth actions consume, so bundles never depend on
|
|
8
|
+
* Better Auth's inferred mega-types.
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
11
|
import { createAuthClient } from "better-auth/client";
|
package/src/server.ts
CHANGED
|
@@ -5,10 +5,9 @@
|
|
|
5
5
|
* (`options.connectors`, carrying the dev server's `local: "sqlite"` stand-ins) when available,
|
|
6
6
|
* else `resolveDialect` over the first-party providers — either way yielding Better Auth's
|
|
7
7
|
* `database: { dialect, type }` Kysely config. `getAuthMigrations` compiles Better Auth's additive
|
|
8
|
-
* system-table sync (
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
* never special-cases auth.
|
|
8
|
+
* system-table sync (`getMigrations` from `better-auth/db/migration` returns { toBeCreated,
|
|
9
|
+
* toBeAdded, runMigrations, compileMigrations }) into push steps of kind "auth", composed by the
|
|
10
|
+
* host after the connector plan — the connector never special-cases auth.
|
|
12
11
|
*/
|
|
13
12
|
|
|
14
13
|
import { betterAuth } from "better-auth";
|