Update GetUserQueryHandler.cs

This commit is contained in:
MeysamMoghaddam
2025-10-12 21:33:52 +03:30
parent 0749578aec
commit a3845060a2

View File

@@ -17,6 +17,14 @@ public class GetUserQueryHandler : IRequestHandler<GetUserQuery, GetUserResponse
{
Id = long.Parse(userId)
}, cancellationToken: cancellationToken);
return response.Adapt<GetUserResponseDto>();
var result = response.Adapt<GetUserResponseDto>();
var getJwtToken = await _context.User.GetJwtTokenAsync(request: new()
{
Id = long.Parse(userId)
}, cancellationToken: cancellationToken);
if(getJwtToken != null && !string.IsNullOrWhiteSpace(getJwtToken.Token))
result.Token = getJwtToken.Token;
return result;
}
}