Skip to content
This repository was archived by the owner on Oct 22, 2025. It is now read-only.

Commit 5212c37

Browse files
committed
fix: update auth request headers reference in chatRoom actor (#1147)
1 parent ed340e2 commit 5212c37

File tree

1 file changed

+3
-3
lines changed
  • examples/better-auth-external-db/src/backend

1 file changed

+3
-3
lines changed

examples/better-auth-external-db/src/backend/registry.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ interface Message {
1717
export const chatRoom = actor({
1818
// onAuth runs on the server & before connecting to the actor
1919
onAuth: async (c: OnAuthOptions) => {
20-
// ✨ NEW ✨ Access Better Auth session
20+
// Access Better Auth session
2121
const authResult = await auth.api.getSession({
22-
headers: c.req.headers,
22+
headers: c.request.headers,
2323
});
2424
if (!authResult) throw new Unauthorized();
2525

@@ -34,7 +34,7 @@ export const chatRoom = actor({
3434
} as State,
3535
actions: {
3636
sendMessage: (c, message: string) => {
37-
// ✨ NEW ✨ — Access Better Auth with c.conn.auth
37+
// Access Better Auth with c.conn.auth
3838
const newMessage = {
3939
id: crypto.randomUUID(),
4040
userId: c.conn.auth.user.id,

0 commit comments

Comments
 (0)