I’m working on an app using 8Base Users with Auth0. Login and registration is all possible and I can make any changes from the dashboard successfully.
One thing that I am trying to do from a React / GraphQL based app is write a mutation that will create a user with a pre-defined user role that I created in the 8Base dashboard. Right now, any user that signs up has “Guest” and “Administrator” by default, but I added an additional role called “Member”.
What would the mutation look like for a user that has the “Member” role? Here’s what I have so far with my User table having a Roles column (currently associated with Users table because I don’t know what else to try):
Hi there, when you use the userSignUpWithPassword mutation, you are setting the authProfileId. That Authentication Profile is where you’re able to set the roles that are added to a user once they sign up.
Otherwise, if it worked like this, and new user could technically assign themselves any roles they want.
So simply take roles: { connect: [{ id: $roleId }] } OUT of your mutation and add the Member role to your authentication profiles settings.
Hi, I am having same query, i understand what you have said but it is for one role ‘Member’ as far as i understand it.
What if there are 2 Roles: Teacher and Student and i want to assign roles while they sign up, i can not create 2 Auth Profile for each role right, How i can assign Teacher role to teacher signup and Student role to student sign up