mirror of
https://github.com/azaion/admin.git
synced 2026-04-22 08:56:33 +00:00
renmove ResourceEnum, use filename only
add ToHash for encryption Key
This commit is contained in:
@@ -33,7 +33,7 @@ public class AuthService(IHttpContextAccessor httpContextAccessor, IOptions<JwtC
|
||||
Id = Guid.Parse(claims[ClaimTypes.NameIdentifier].Value),
|
||||
Email = claims[ClaimTypes.Name].Value,
|
||||
Role = role,
|
||||
HardwareId = claims[Constants.HARDWARE_ID].Value,
|
||||
HardwareHash = claims[Constants.HARDWARE_ID].Value,
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -49,7 +49,7 @@ public class AuthService(IHttpContextAccessor httpContextAccessor, IOptions<JwtC
|
||||
new Claim(ClaimTypes.NameIdentifier, user.Id.ToString()),
|
||||
new Claim(ClaimTypes.Name, user.Email),
|
||||
new Claim(ClaimTypes.Role, user.Role.ToString()),
|
||||
new Claim(Constants.HARDWARE_ID, user.HardwareId ?? "")
|
||||
new Claim(Constants.HARDWARE_ID, user.HardwareHash ?? "")
|
||||
]),
|
||||
Expires = DateTime.UtcNow.AddHours(jwtConfig.Value.TokenLifetimeHours),
|
||||
Issuer = jwtConfig.Value.Issuer,
|
||||
|
||||
Reference in New Issue
Block a user