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