migrate to identity for authentication
All checks were successful
Build and Deploy API / build-and-deploy (push) Successful in 12s

This commit is contained in:
2026-03-21 15:38:05 -05:00
parent ef4f0c0159
commit 3dd0460209
10 changed files with 397 additions and 29 deletions

View File

@@ -22,13 +22,17 @@ public class JwtService {
var creds = new SigningCredentials(key, SecurityAlgorithms.HmacSha256);
if(user.UserName == null) return null;
// not too sure
var claims = new[] {
new Claim(ClaimTypes.Name, user.Name),
new Claim(ClaimTypes.Name, user.UserName),
new Claim(ClaimTypes.NameIdentifier, user.Id.ToString())
};
var token = new JwtSecurityToken(
issuer: "agologum",
audience: "agologum",
claims: claims,
expires: DateTime.UtcNow.AddHours(2), // will add a refresher later
signingCredentials: creds