getSession always returns null
i have the following auth-middleware that i can confirm is receiving a proper header. I manually search for the session and was able to get a matching record from the db. I did this both inside a db client and within the middleware using the db adapter to retrieve the record. I see that have bee others with similiar issues. I was wondering if this is a known issue (i don't see a open issue on github) or if there is a work around. I'm setting up the server so i don't have a client setup. I'm using a rest client to make calls into the server. I'm on the latest version of better-auth
auth-middleware
auth.ts
index.ts - app and routing setup
1 Reply
he token value is saved in cookie actually
[1:58 PM]ririxi: like, better-auth client handles saving cookie
[1:58 PM]ririxi: but server responds with that "token"
[1:58 PM]ririxi: you would need to enable bearer to work with tokens normally
[1:59 PM]Joshuadeleon: Ahh gotcha. Makes sense. thanks for the help!