Getting session from Bearer token does not work

Hey, for some reason I can't get authenticating with the Bearer token to work. According to the docs it should be enough to call this, with the authorization header containing the bearer token.

const session = await auth.api.getSession({
    headers: req.headers
  });

However this does not return any session. I am getting the Bearer token from the set-auth-jwtheader. Am I missing something?

EDIT: Looking deeper into this, the authorization header is definitely received by better-auth but then never converted to the cookie for some reason
Was this page helpful?