auth.api.getSession always returning null

Hello everyone. I am trying to create a monorepo using the create-t3-turbo template, and I saw Bekacru created a fork with an example for implementing better-auth on the create-t3-turbo template:
https://github.com/Bekacru/create-t3-turbo
I mostly followed the changes he made while updating to the latest version (1.1.3).
I managed to get it mostly working, I can sign in and sign up in the mobile app as expected, but for some reason when I try to use auth.api.getSession it always returns null, and so, trpc doesn't have a session saved and I cant use the session data for protecting the procedures.
the headers are being passed into getSession with a bearer token.
Not sure what I'm missing and what parts of the codebase I gotta post here to get help without leaking too much sensitive stuff

heres how the getSession helper is defined:
import { headers } from "next/headers"; import { auth } from "./auth"; export const getSession = async () => auth.api.getSession({ headers: headers(), }); export * from "./auth";
GitHub
Clean and simple starter repo using the T3 Stack along with Expo React Native - Bekacru/create-t3-turbo
Was this page helpful?