manu²
BABetter Auth
•Created by manu² on 3/11/2025 in #help
Adding custom user fields (role, address, etc.) to auth.api.getSession()
When I call:
I get the following Drizzle Query:
Is there a way I can customize this query (in my settings or in the
auth.api.getSession
call) to include values like the role, address, subscription, etc, so that I'm able to access it from session.user
object?
I've seen the docs on customizing the session but if I use the suggested implementation I'll be hitting the database twice - once to get the default fields, and the second time to get the custom fields - and I don't want that.
Is there a way I can directly customize the query called by auth.api.getSession
so we're querying the database only once to get all of the information required?
Thanks!
3 replies
BABetter Auth
•Created by manu² on 2/22/2025 in #help
Neon Authorize + Better Auth JWT + Drizzle + Row Level Security
has anyone managed to set this up? (or something similar) The Neon Authorize docs don't have an "official" guide for how we can use better-auth :(
i just started using better-auth today, so i'm new to this library! i would really appreciate advice on how to implement this/a barebones template if there is one. thank you!
34 replies