Security.Identity icon indicating copy to clipboard operation
Security.Identity copied to clipboard

Default role for new users

Open kek-Sec opened this issue 2 years ago • 1 comments

Hey, first of all thank you for this great library, I've got two quick questions , I've looked through the demo but I'm still unsure of the correct way to do this.

  1. How to set a default Role to new users , should this be done in a way similar to this or am I off?
  2. Users with a specified role do not inherit the claims of the role , is there a setting to turn this on?

Thanks in advance!

kek-Sec avatar Aug 10 '22 07:08 kek-Sec

Update on question 1. currently added the following code to the Register function (in the controller) before fetching the JWT , seems to be working

await _userManager.AddToRoleAsync(user, "Customer");

with _userManager being UserManager<IdentityUser> _userManager;

kek-Sec avatar Aug 10 '22 07:08 kek-Sec