@checkstack/auth-backend 0.4.12 → 0.4.14
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 +28 -0
- package/package.json +1 -1
- package/src/index.ts +6 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,33 @@
|
|
|
1
1
|
# @checkstack/auth-backend
|
|
2
2
|
|
|
3
|
+
## 0.4.14
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [23c80bc]
|
|
8
|
+
- @checkstack/backend-api@0.10.0
|
|
9
|
+
- @checkstack/command-backend@0.1.15
|
|
10
|
+
|
|
11
|
+
## 0.4.13
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- e01945b: Reduce excessive /api/auth/get-session requests
|
|
16
|
+
|
|
17
|
+
- Enable better-auth's `cookieCache` on the server (5-minute TTL) so repeated session
|
|
18
|
+
checks verify a signed cookie instead of querying the database. Compatible with
|
|
19
|
+
horizontal scaling since validation uses the shared `BETTER_AUTH_SECRET`.
|
|
20
|
+
|
|
21
|
+
- Introduce a `SessionProvider` React context that fetches the session exactly once
|
|
22
|
+
at the top of the component tree. All 7+ components that previously called
|
|
23
|
+
`useSession()` independently now read from this shared context — eliminating
|
|
24
|
+
duplicate HTTP requests on every page load.
|
|
25
|
+
|
|
26
|
+
- Remove the `useAuthClient()` hook which created per-component better-auth client
|
|
27
|
+
instances via `useMemo`, causing separate nanostore atoms and independent fetches.
|
|
28
|
+
All imperative usages (signIn, signUp, resetPassword, etc.) now use the singleton
|
|
29
|
+
`getAuthClientLazy()` instead.
|
|
30
|
+
|
|
3
31
|
## 0.4.12
|
|
4
32
|
|
|
5
33
|
### Patch Changes
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -639,6 +639,12 @@ export default createBackendPlugin({
|
|
|
639
639
|
provider: "pg",
|
|
640
640
|
schema: { ...schema },
|
|
641
641
|
}),
|
|
642
|
+
session: {
|
|
643
|
+
cookieCache: {
|
|
644
|
+
enabled: true,
|
|
645
|
+
maxAge: 5 * 60, // 5 minutes — session verified from signed cookie, not DB
|
|
646
|
+
},
|
|
647
|
+
},
|
|
642
648
|
emailAndPassword: {
|
|
643
649
|
enabled: credentialEnabled,
|
|
644
650
|
autoSignIn: true, // Log in user immediately after successful registration
|