How to know if the signed in user is a new user? (For both Password and OAuth)

Hi, I am building my SaaS using better-auth and Nextjs. I want to create a doc in the MongoDB for the new users. However, I am not able to figure out how to do this. Please help me. my setup: MongoDB (no mongoose) no ORM Better Auth NextJs
1 Reply
bekacru
bekacru4w ago
For password check if the path is signup and for oauth you can use user.createdAt field to check if the user is just created or not and use hooks to add a query param on the callback url

Did you find this page helpful?