Use Env Var In `TokenService`

This commit is contained in:
Alan Moon 2025-06-16 13:24:29 -07:00
parent 6961b78de4
commit c69609101f

View File

@ -29,7 +29,7 @@ namespace qtc_api.Services.TokenService
new Claim(ClaimTypes.Role, user.Role)
};
var key = new SymmetricSecurityKey(Encoding.UTF8.GetBytes(_configuration.GetSection("Jwt:Key").Value!));
var key = new SymmetricSecurityKey(Encoding.UTF8.GetBytes(_configuration.GetSection("Jwt:Key").Value ?? Environment.GetEnvironmentVariable("JWT_KEY")!));
var issuer = _configuration["Jwt:Issuer"];
var audience = _configuration["Jwt:Audience"];