fynn
fynn4h ago

hono, next.js ssr & better-auth cookies

hey guys, I am currently trying to use Better Auth with tRPC server side with a hono backend. In my backend, I am checking for the session like this: const session = await auth.api.getSession({ headers: c.req.raw.headers }); in my trpc batchLink, I just tried to put headers like this:
async headers() {
const h = await nextHeaders();

return Object.fromEntries(header.entries());
},
async headers() {
const h = await nextHeaders();

return Object.fromEntries(header.entries());
},
with that, I am still UNAUTHORIZED; even if I am authorized on the client. does anyone know what I could do there? seems like it wont accept the headers?
0 Replies
No replies yetBe the first to reply to this messageJoin

Did you find this page helpful?