Custom User Role with Providers (Google, FB, Email)

System Information
  • Strapi Version: 4.3.2
  • Operating System: Win 64
  • Database: Pg
  • Node Version: 16.9
  • NPM Version: irrelevant
  • Yarn Version: irrelevant

Hello, I have 2 custom user roles - seller and buyer. On the front-end, I have 2 routes that define which role will be assigned to new users /account-buyer/signin and /account-seller/signin.

I tried to make a copy from node_modules\@strapi\plugin-users-permissions\server\controllers\auth.js to src\extensions\users-permissions\controllers\auth.js. but nothing seems to happen.

Also, I’m not sure how to throw the user type through all of these back-and-forth redirects of Google (for example).

How could I solve it?

Or let’s say:

  1. save the needed role in localstorage at the moment the provider button is clicked
  2. register the default Authenticated user
  3. on the redirect page read the value that has to be set.
  4. How can I update the user’s role in this case?

Thank you.