auth on server

I use next.js and better-auth. And it throws an error when I try to authenticate user on server side.
const session = await auth.api.getSession({
headers: await headers(),
});
const session = await auth.api.getSession({
headers: await headers(),
});
1 Reply
daveycodez
daveycodez5mo ago
Did you set up the nextCookies plugin and what is the error being thrown

Did you find this page helpful?