fixed custom claims factory missing role claims
This commit is contained in:
parent
ac7fa0c58e
commit
07f9f94f82
|
@ -4,8 +4,11 @@
|
|||
|
||||
namespace Wave.Data;
|
||||
|
||||
public class UserClaimsFactory(UserManager<ApplicationUser> userManager, IOptions<IdentityOptions> optionsAccessor)
|
||||
: UserClaimsPrincipalFactory<ApplicationUser>(userManager, optionsAccessor) {
|
||||
public class UserClaimsFactory(
|
||||
UserManager<ApplicationUser> userManager,
|
||||
RoleManager<IdentityRole> roleManager,
|
||||
IOptions<IdentityOptions> options)
|
||||
: UserClaimsPrincipalFactory<ApplicationUser, IdentityRole>(userManager, roleManager, options) {
|
||||
protected override async Task<ClaimsIdentity> GenerateClaimsAsync(ApplicationUser user) {
|
||||
var principal = await base.GenerateClaimsAsync(user);
|
||||
principal.AddClaim(new Claim("Id", user.Id));
|
||||
|
|
Loading…
Reference in a new issue