This commit is contained in:
Shaun Walker
2022-03-30 22:08:32 -04:00
parent 8ddaf57e17
commit a70f1ee1e0
12 changed files with 134 additions and 94 deletions

View File

@ -36,7 +36,7 @@ namespace Oqtane.Infrastructure
var user = jwtManager.ValidateToken(token, secret, sitesettings.GetValue("JwtOptions:Issuer", ""), sitesettings.GetValue("JwtOptions:Audience", ""));
if (user != null)
{
// populate principal (reload user roles to ensure most accurate permission assigments)
// populate principal (reload user roles to ensure most accurate permissions)
var _userRoles = context.RequestServices.GetService(typeof(IUserRoleRepository)) as IUserRoleRepository;
var principal = (ClaimsIdentity)context.User.Identity;
UserSecurity.ResetClaimsIdentity(principal);
@ -52,7 +52,8 @@ namespace Oqtane.Infrastructure
}
}
await _next(context);
// continue processing
if (_next != null) await _next(context);
}
}
}