I'm currently working on building a marketplace. So far, everything is working fine with next-auth. I want two roles: customer and provider. I am trying to figure out a way to force registration for one of them, but not quite sure how. Right now, the only way I see it, is that I check the roles on each page and if they are neither customer or provider, then redirect to a page that makes them select one of them so I can assign it to their entry in the db, and then I will be able to show each page correspondingly to their role. I was wondering if there is a better option of forcing it, for example:
Click sign up -> Are you customer or provider -> whichever they choose they get to a page of Oauth sign in options and somehow I can save the fact what they chose in the previous setup and automatically fetch it in events: {createUser()} in [...nextauth].ts if possible, this would be the ideal way.
Can someone please chime in if they have any ideas on a smooth way to force a role on sign up? Thanks!