|
|
@ -54,6 +54,7 @@ namespace CORRESPONSALBackend.Controllers |
|
|
|
claims.Add(new Claim("Departamento", (user.sDept ?? user.sDept ?? "No asignado"))); |
|
|
|
claims.Add(new Claim("Departamento", (user.sDept ?? user.sDept ?? "No asignado"))); |
|
|
|
claims.Add(new Claim("UserType", (user != null) ? user.TipoUsuario.ToString() : "0")); |
|
|
|
claims.Add(new Claim("UserType", (user != null) ? user.TipoUsuario.ToString() : "0")); |
|
|
|
claims.Add(new Claim("Perfil", ProfileData.Perfil)); |
|
|
|
claims.Add(new Claim("Perfil", ProfileData.Perfil)); |
|
|
|
|
|
|
|
claims.Add(new Claim("IdCorresponsal", user.IdCorresponsal != null ? user.IdCorresponsal.ToString() : "0")); |
|
|
|
foreach (Menu item in menu) { claims.Add(new Claim(ClaimTypes.Role, item.Url)); } |
|
|
|
foreach (Menu item in menu) { claims.Add(new Claim(ClaimTypes.Role, item.Url)); } |
|
|
|
var key = new SymmetricSecurityKey(Encoding.UTF8.GetBytes(_config["Jwt:Key"])); |
|
|
|
var key = new SymmetricSecurityKey(Encoding.UTF8.GetBytes(_config["Jwt:Key"])); |
|
|
|
var signIn = new SigningCredentials(key, SecurityAlgorithms.HmacSha256); |
|
|
|
var signIn = new SigningCredentials(key, SecurityAlgorithms.HmacSha256); |
|
|
|