How to add a role during signup using next-auth with Google Provider?

Viewed 469

I am working on a personal project which has different types of users, namely: "customer", "seller". I am using Nextjs along with Next-Auth to work on this project.

I am using GoogleProvider offered by Next-Auth to sign-in in conjunction with a PostgreSQL database to store the user information.

What I would like to do is for the user to be able to sign in using their Google account and check if such a user exists in the database. If not, offer them the choice to sign up as a "customer" or as a "seller".

I am unable to find good resources addressing this use case. I would like to know if it's possible to achieve this using the setup described above.

0 Answers
Related