Hook into Post oauth login flow

How can I hook into the flow before better Auth creates the user and check, if the discord id ia regestres, if yes and there is no User then create it. Thanks!
2 Replies
KiNFiSH
KiNFiSH7d ago
please check on this https://www.better-auth.com/docs/concepts/database#database-hooks and even use can use hooks in general with custom path matcher - https://www.better-auth.com/docs/concepts/hooks
Hooks | Better Auth
Better Auth Hooks let you customize BetterAuth's behavior
Database | Better Auth
Learn how to use a database with Better Auth.
abwegig
abwegigOP6d ago
Thanks How can I determine if to continue or not by checking account params. Because it first checks user and then account and if I stop the account hook it creates a user anyway.

Did you find this page helpful?