Augustas Paliulis
BABetter Auth
•Created by Augustas Paliulis on 2/23/2025 in #help
Integrate new table schema created using plugin with authentication
Hello, I have created new table schema using plugin, and now I would like to integrate and populate that table during authentication.
It might be the cas that I haven't seen required documentation on that, so link to that could also help.
Basically I have this TermsOfService table plugin:
and I have inserted this plugin in config:
Should I create hook for populating that table? If so should I create connection myself, or is there a way to do this using better-auth. Thanks!
2 replies
BABetter Auth
•Created by Augustas Paliulis on 2/23/2025 in #bug-reports
Typescript error on plugin schema reference field
When creating plugin for table schema, and adding reference to another table (e.g.
user
) I get TS error that instaed of reference
it should be references
My code:
13 replies
BABetter Auth
•Created by Augustas Paliulis on 2/16/2025 in #help
Blocking specific routes based on user session
Hey, I was wondering what's the best approach to get user session and based on it prevent specific routes in website?
I though of doing that through middleware, however inside middlare I can't get session using this method:
As I it is not allowed to use Node’s dgram module in Edge runtime
What would be correct approach for this task?
10 replies
BABetter Auth
•Created by Augustas Paliulis on 2/11/2025 in #help
Closing DB pool
Hello, I was reading Optimization guide, and noticed that a good practice for database optimization is closing it's connection pool:
Always close connections when they are no longer needed to return them to the poolI am using MS SQL database with
Kysely
set up described in their documentation.
Since I am pretty new with creating my own set up of database, I am a bit confused on this.
So my Question is should I take care myself of closing this DB connection pool, or is it done by library? Is there a way to test it?1 replies