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:
Hooks | Better Auth
Better Auth Hooks let you customize BetterAuth's behavior
Jump to solution
8 Replies
s
sOP2w ago
@Ping
Nico64
Nico642w ago
Hooks | Better Auth
Better Auth Hooks let you customize BetterAuth's behavior
Nico64
Nico642w ago
Database | Better Auth
Learn how to use a database with Better Auth.
s
sOP2w ago
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.
rhys
rhys2w ago
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.
trx🪐
trx🪐2w ago
oh okay bro, sorry (i'm a friend of subdevl)
s
sOP2w ago
how can i get the session inside the createAuthMiddleware?
Solution
rhys
rhys2w ago
Hooks | Better Auth
Better Auth Hooks let you customize BetterAuth's behavior

Did you find this page helpful?