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 ed84b83620
commit 5a00bfd91f
8 changed files with 40 additions and 38 deletions

View File

@@ -32,7 +32,10 @@ public class ResendConfirmationEmailHandler(
if (await authRepository.IsUserVerifiedAsync(request.UserId))
return; // Already confirmed, no-op
string confirmationToken = tokenService.GenerateConfirmationToken(user);
string confirmationToken = tokenService.GenerateConfirmationToken(
user.UserAccountId,
user.Username
);
await mediator.Send(
new SendResendConfirmationEmailCommand(user.FirstName, user.Email, confirmationToken),
cancellationToken