@jxsuite/auth 0.3.1 → 0.4.1
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/LICENSE +21 -0
- package/README.md +1 -1
- package/package.json +5 -5
- package/src/client.ts +5 -5
- package/src/server.ts +3 -4
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Kevin Shenk
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
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.
|
|
3
|
+
"version": "0.4.1",
|
|
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.
|
|
42
|
-
"@jxsuite/schema": "^1.
|
|
43
|
-
"better-auth": "1.6.
|
|
41
|
+
"@jxsuite/connector": "^0.4.1",
|
|
42
|
+
"@jxsuite/schema": "^1.4.0",
|
|
43
|
+
"better-auth": "^1.6.25",
|
|
44
44
|
"kysely": "^0.29.4"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
|
-
"@happy-dom/global-registrator": "^20.
|
|
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";
|