Migrate TokenService.RefreshTokenAsync to UserManager

Last remaining IAuthRepository call site; RefreshTokenResult now
carries a plain (Guid, string) instead of UserAccount.
This commit is contained in:
Aaron Po
2026-08-22 01:36:27 -04:00
parent 2e5f02fb38
commit 6b9c14c14b
6 changed files with 37 additions and 37 deletions

View File

@@ -1,4 +1,3 @@
using Domain.Entities;
using Features.Auth.Commands.RefreshToken;
using Features.Auth.Dtos;
using Features.Auth.Services;
@@ -15,11 +14,12 @@ public class RefreshTokenHandlerTests
Mock<ITokenService> tokenServiceMock = new();
RefreshTokenHandler handler = new(tokenServiceMock.Object);
Guid userId = Guid.NewGuid();
UserAccount user = new() { UserAccountId = userId, Username = "testuser" };
tokenServiceMock
.Setup(x => x.RefreshTokenAsync("old-refresh-token"))
.ReturnsAsync(new RefreshTokenResult(user, "new-refresh-token", "new-access-token"));
.ReturnsAsync(
new RefreshTokenResult(userId, "testuser", "new-refresh-token", "new-access-token")
);
LoginPayload result = await handler.Handle(
new RefreshTokenCommand("old-refresh-token"),