snouzy
BABetter Auth
โขCreated by snouzy on 4/18/2025 in #help
Is it a possible to use a relation table as type for fields in additionalFields ? (beginner ๐
)
I'm currently working with better-auth and Iโd like to access the
pages
field of the user directly from the session (code snippet below). (It's another table).
Is it possible / a good idea to include this kind of data directly in the session (via customSession) or should I rather fetch it separately using a /me
endpoint after login?
Iโm not an auth expert, so Iโm not 100% sure what the best practice is here โ any feedback or guidance would be super appreciated! ๐
Hereโs what Iโve got so far ๐
TLDR ;
โ
Is it okay to include pages directly in the session?
๐ค Or is it better to keep the session lightweight and fetch /me
on the client side?
4 replies