Incorrect Response Data
Hi there I have setup better auth to be snake case but when i use
but this is what returned to me
i expected the response to look like this
Solution:Jump to solution
There isn't a solution which will solve all cases of returned data, however the primary data you'll receive is likely from
useSession
/ getSession
, which fortunutely has a way to suit your needs.
I recommend checking out the custom session plugin which you can return lowercase names as needed....Session Management | Better Auth
Better Auth session management.
4 Replies
Hello, our internal adapter system translates the data accordingly.
All plugins and internal code is built around consistent naming of these variables.
If that data were to change because your database field names were different, all plugins and internal systems wouldn't work.
Is there a specific reason you need it lowercase?
Hi there thank you for clarifying. Currently when i want to login i need to get the user id from better auth and make a query to my database so my data returns as snake case which is consistent across my api
Solution
There isn't a solution which will solve all cases of returned data, however the primary data you'll receive is likely from
useSession
/ getSession
, which fortunutely has a way to suit your needs.
I recommend checking out the custom session plugin which you can return lowercase names as needed.Session Management | Better Auth
Better Auth session management.
yup just what i needed. thank you