Is there a onRegister handler for NextAuth?

Hi folks, how would you go about creating a onRegister function on NextAuth for new users? Their documentation does not have this, I don't know why. I want to generate some data on DB whenever a new user is logged in for the very first time
Solution:
have you looked at the createUser event? https://next-auth.js.org/configuration/events#createuser
Events | NextAuth.js
Events are asynchronous functions that do not return a response, they are useful for audit logs / reporting or handling any other side-effects.
Jump to solution
2 Replies
Solution
Sturlen
Sturlen2y ago
have you looked at the createUser event? https://next-auth.js.org/configuration/events#createuser
Events | NextAuth.js
Events are asynchronous functions that do not return a response, they are useful for audit logs / reporting or handling any other side-effects.
Gabriel
GabrielOP2y ago
Thank you! I couldn't find this page!
Want results from more Discord servers?
Add your server