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

This commit is contained in:
Dhananjaya99
2026-10-18 12:45:58 +05:30
parent 703d21d56c
commit fbd079d337
14 changed files with 12 additions and 350 deletions
+2 -9
View File
@@ -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,