create-vexcms 0.1.0-alpha.8 → 0.1.0-alpha.9
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/package.json
CHANGED
|
@@ -24,11 +24,11 @@
|
|
|
24
24
|
"@t3-oss/env-nextjs": "0.13.11",
|
|
25
25
|
"@tanstack/react-form": "1.33.1",
|
|
26
26
|
"@tanstack/react-query": "5.101.2",
|
|
27
|
-
"@vexcms/better-auth": "~0.1.0-alpha.
|
|
28
|
-
"@vexcms/core": "~0.1.0-alpha.
|
|
29
|
-
"@vexcms/file-storage-convex": "~0.1.0-alpha.
|
|
30
|
-
"@vexcms/next": "~0.1.0-alpha.
|
|
31
|
-
"@vexcms/react": "~0.1.0-alpha.
|
|
27
|
+
"@vexcms/better-auth": "~0.1.0-alpha.9",
|
|
28
|
+
"@vexcms/core": "~0.1.0-alpha.9",
|
|
29
|
+
"@vexcms/file-storage-convex": "~0.1.0-alpha.9",
|
|
30
|
+
"@vexcms/next": "~0.1.0-alpha.9",
|
|
31
|
+
"@vexcms/react": "~0.1.0-alpha.9",
|
|
32
32
|
"better-auth": "1.6.23",
|
|
33
33
|
"class-variance-authority": "0.7.1",
|
|
34
34
|
"clsx": "2.1.1",
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"@types/node": "20.19.43",
|
|
53
53
|
"@types/react": "19.2.17",
|
|
54
54
|
"@types/react-dom": "19.2.3",
|
|
55
|
-
"@vexcms/cli": "~0.1.0-alpha.
|
|
55
|
+
"@vexcms/cli": "~0.1.0-alpha.9",
|
|
56
56
|
"babel-plugin-react-compiler": "1.0.0",
|
|
57
57
|
"eslint": "9.39.5",
|
|
58
58
|
"eslint-config-next": "15.5.9",
|
|
@@ -2,9 +2,23 @@ import { api } from "@convex/_generated/api"
|
|
|
2
2
|
import { fetchQuery } from "convex/nextjs"
|
|
3
3
|
import { cookies } from "next/headers"
|
|
4
4
|
|
|
5
|
+
const SESSION_COOKIE = "better-auth.session_token"
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Read the Better Auth session token from cookies.
|
|
9
|
+
*
|
|
10
|
+
* Better Auth prefixes its cookies with `__Secure-` whenever the resolved
|
|
11
|
+
* `baseURL` is https. Locally over http the cookie is
|
|
12
|
+
* `better-auth.session_token`; on a real domain it is
|
|
13
|
+
* `__Secure-better-auth.session_token`. Reading only the bare name works in
|
|
14
|
+
* development and silently returns `null` in production — no error, just an
|
|
15
|
+
* anonymous caller. Check the prefixed name first, as Better Auth's own reader
|
|
16
|
+
* does.
|
|
17
|
+
*/
|
|
5
18
|
export async function getSessionToken() {
|
|
6
19
|
const cookieStore = await cookies()
|
|
7
|
-
const sessionTokenCookie =
|
|
20
|
+
const sessionTokenCookie =
|
|
21
|
+
cookieStore.get(`__Secure-${SESSION_COOKIE}`)?.value ?? cookieStore.get(SESSION_COOKIE)?.value
|
|
8
22
|
|
|
9
23
|
if (!sessionTokenCookie) {return null}
|
|
10
24
|
|