Remove role management from AuthHex; update documentation and user handling to reflect ERP ownership of roles.
CI/CD - erp auth / Build & Deploy (pull_request) Failing after 15m9s
CI/CD - erp auth / Build & Deploy (pull_request) Failing after 15m9s
This commit is contained in:
@@ -22,13 +22,8 @@ public class JwtTokenHelper
|
||||
|
||||
public async Task<string> GenerateToken(User user)
|
||||
{
|
||||
// Load user's role and usertype if not already loaded
|
||||
if (user.Role == null)
|
||||
{
|
||||
await _dbContext.Entry(user)
|
||||
.Reference(u => u.Role)
|
||||
.LoadAsync();
|
||||
}
|
||||
// Load the user's usertype if not already loaded. (No role: authorization belongs to the ERP, which reads the
|
||||
// person's role from its own tables - the token only says who the person is.)
|
||||
if (user.UserType == null)
|
||||
{
|
||||
await _dbContext.Entry(user)
|
||||
@@ -41,8 +36,6 @@ public class JwtTokenHelper
|
||||
new Claim("UserId", user.Id.ToString()),
|
||||
new Claim("UserTypeId", user.UserTypeId.ToString()),
|
||||
new Claim("UserTypeCode", user.UserType?.Code ?? ""),
|
||||
new Claim("RoleId", user.RoleId.ToString()),
|
||||
new Claim("RoleCode", user.Role?.Code ?? ""),
|
||||
new Claim("NIC", user.Nic ?? ""),
|
||||
new Claim(JwtRegisteredClaimNames.Jti, Guid.NewGuid().ToString()),
|
||||
new Claim(JwtRegisteredClaimNames.Iat,
|
||||
|
||||
Reference in New Issue
Block a user