@beignet/provider-auth-better-auth 0.0.37 → 0.0.39
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 +8 -0
- package/README.md +12 -13
- package/package.json +1 -1
- package/skills/auth-provider/SKILL.md +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @beignet/provider-auth-better-auth
|
|
2
2
|
|
|
3
|
+
## 0.0.39
|
|
4
|
+
|
|
5
|
+
## 0.0.38
|
|
6
|
+
|
|
7
|
+
### Patch Changes
|
|
8
|
+
|
|
9
|
+
- 1081ac6: Harden HTTP response handling, synchronous upload cleanup, CLI path and registry diagnostics, provider context preservation, Redis subscription observability, and provider documentation.
|
|
10
|
+
|
|
3
11
|
## 0.0.37
|
|
4
12
|
|
|
5
13
|
## 0.0.36
|
package/README.md
CHANGED
|
@@ -143,13 +143,13 @@ export type AppContext = {
|
|
|
143
143
|
```
|
|
144
144
|
|
|
145
145
|
```ts
|
|
146
|
-
// infra/
|
|
146
|
+
// infra/port-wiring.ts
|
|
147
147
|
import { createGate, definePorts } from "@beignet/core/ports";
|
|
148
148
|
import type { AppPorts } from "@/ports";
|
|
149
149
|
|
|
150
150
|
const gate = createGate({ policies: [] });
|
|
151
151
|
|
|
152
|
-
export const
|
|
152
|
+
export const initialPorts = definePorts<AppPorts>()({
|
|
153
153
|
bound: { gate },
|
|
154
154
|
deferred: ["auth"],
|
|
155
155
|
});
|
|
@@ -180,7 +180,7 @@ export const appContext = defineServerContext<AppContext, AppRuntimePorts>()({
|
|
|
180
180
|
```ts
|
|
181
181
|
// server/index.ts
|
|
182
182
|
import { createNextServer, createNextServerLoader } from "@beignet/next";
|
|
183
|
-
import {
|
|
183
|
+
import { initialPorts } from "@/infra/port-wiring";
|
|
184
184
|
import { appContext } from "@/server/context";
|
|
185
185
|
import { routes } from "@/server/routes";
|
|
186
186
|
|
|
@@ -188,7 +188,7 @@ export const getServer = createNextServerLoader(async () => {
|
|
|
188
188
|
const { providers } = await import("./providers");
|
|
189
189
|
|
|
190
190
|
return createNextServer({
|
|
191
|
-
ports:
|
|
191
|
+
ports: initialPorts,
|
|
192
192
|
providers,
|
|
193
193
|
context: appContext,
|
|
194
194
|
routes,
|
|
@@ -459,12 +459,11 @@ export const requireAuth = async (
|
|
|
459
459
|
|
|
460
460
|
### Multiple authentication strategies
|
|
461
461
|
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
Better Auth supports multiple strategies out of the box, so the first approach is recommended.
|
|
462
|
+
Configure multiple strategies through Better Auth when its plugins cover the
|
|
463
|
+
required session, bearer, or API-key behavior. When an app needs authentication
|
|
464
|
+
outside Better Auth, compose that logic in an app-owned `AuthPort` adapter or
|
|
465
|
+
HTTP auth hook; this package intentionally exports only the Better Auth
|
|
466
|
+
provider.
|
|
468
467
|
|
|
469
468
|
## Type safety
|
|
470
469
|
|
|
@@ -537,14 +536,14 @@ cookie-only check does not validate the session.
|
|
|
537
536
|
import { betterAuth } from "better-auth";
|
|
538
537
|
import { createNextServer } from "@beignet/next";
|
|
539
538
|
import { createBetterAuthProvider } from "@beignet/provider-auth-better-auth";
|
|
540
|
-
import {
|
|
539
|
+
import { initialPorts } from "@/infra/port-wiring";
|
|
541
540
|
import { appContext } from "@/server/context";
|
|
542
541
|
import { routes } from "@/server/routes";
|
|
543
542
|
|
|
544
543
|
const auth = betterAuth({ database: db });
|
|
545
544
|
|
|
546
545
|
const server = await createNextServer({
|
|
547
|
-
ports:
|
|
546
|
+
ports: initialPorts,
|
|
548
547
|
providers: [createBetterAuthProvider(auth)],
|
|
549
548
|
context: appContext,
|
|
550
549
|
routes,
|
|
@@ -568,7 +567,7 @@ const authHook = {
|
|
|
568
567
|
};
|
|
569
568
|
|
|
570
569
|
const server = await createNextServer({
|
|
571
|
-
ports:
|
|
570
|
+
ports: initialPorts,
|
|
572
571
|
providers: [createBetterAuthProvider(auth)],
|
|
573
572
|
hooks: [authHook],
|
|
574
573
|
context: appContext,
|
package/package.json
CHANGED
|
@@ -7,7 +7,7 @@ description: "Wire Beignet Better Auth integration with @beignet/provider-auth-b
|
|
|
7
7
|
|
|
8
8
|
Use this skill when working in an app that depends on
|
|
9
9
|
`@beignet/provider-auth-better-auth`. Read local `AGENTS.md`,
|
|
10
|
-
`lib/better-auth.ts`, auth route files, `ports/`, `infra/
|
|
10
|
+
`lib/better-auth.ts`, auth route files, `ports/`, `infra/port-wiring.ts`,
|
|
11
11
|
`server/context.ts`, and `server/providers.ts` before changing auth code.
|
|
12
12
|
|
|
13
13
|
## Ownership
|
|
@@ -42,7 +42,7 @@ Add `auth` to `definePorts(...)` as a deferred port because the provider
|
|
|
42
42
|
contributes it at startup.
|
|
43
43
|
|
|
44
44
|
```ts
|
|
45
|
-
export const
|
|
45
|
+
export const initialPorts = definePorts<AppPorts>()({
|
|
46
46
|
bound: { gate },
|
|
47
47
|
deferred: ["auth"],
|
|
48
48
|
});
|