Decouple ITokenService from UserAccount entity

Token generation only ever needed the id/username, not the full UserAccount.
This commit is contained in:
Aaron Po
2026-08-22 01:28:41 -04:00
parent 7793129284
commit 885b2a9570
8 changed files with 40 additions and 38 deletions

View File

@@ -48,19 +48,19 @@ public interface ITokenService
/// Generates a signed access token for the given user, expiring after
/// <see cref="TokenServiceExpirationHours.AccessTokenHours" /> hours.
/// </summary>
string GenerateAccessToken(UserAccount user);
string GenerateAccessToken(Guid userId, string username);
/// <summary>
/// Generates a signed refresh token for the given user, expiring after
/// <see cref="TokenServiceExpirationHours.RefreshTokenHours" /> hours.
/// </summary>
string GenerateRefreshToken(UserAccount user);
string GenerateRefreshToken(Guid userId, string username);
/// <summary>
/// Generates a signed confirmation token for the given user, expiring after
/// <see cref="TokenServiceExpirationHours.ConfirmationTokenHours" /> hours.
/// </summary>
string GenerateConfirmationToken(UserAccount user);
string GenerateConfirmationToken(Guid userId, string username);
/// <summary>Validates an access token's signature and expiration and extracts the caller's identity.</summary>