guys, is it possible to do with better-aauth??
Guys, do you know if it's possible for me to do this?
On the front end, log in with discord, any other provider, after logging in, send a request to the backend to set the user in the database, however, I wanted to send the jwt (I don't know if this is used in the cookie) to check whether or not the user is in the database
after front-end signin --> back-end request to set the user to db, (do not set by front end)
Solution:Jump to solution
Hooks | Better Auth
Better Auth Hooks let you customize BetterAuth's behavior
8 Replies
@Ping
Maybe with the hooks https://www.better-auth.com/docs/concepts/hooks
Hooks | Better Auth
Better Auth Hooks let you customize BetterAuth's behavior
Or database hooks https://www.better-auth.com/docs/concepts/database#database-hooks
Database | Better Auth
Learn how to use a database with Better Auth.
It's okay if I don't store the user in the DB directly from better-auth (frontend) but store it directly from the backend via the request.
As Nico says, hooks sound like they'd do the trick. Just fyi it's not great manners to ping maintainers directly- they literally just pushed a new release, and are very busy.
oh okay bro, sorry
(i'm a friend of subdevl)
how can i get the session inside the createAuthMiddleware?
Solution
Hooks | Better Auth
Better Auth Hooks let you customize BetterAuth's behavior