Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
🐛 fix: resolve ValidationException ambiguity and null reference issues
- Use fully qualified FluentValidation.ValidationException in command handlers
  to resolve ambiguity with Luminous.Application.Common.Exceptions.ValidationException
- Make LinkedDeviceDto.RefreshToken nullable to match AuthResultDto.RefreshToken
  • Loading branch information
claude committed Dec 23, 2025
commit 79c03fc0e1725599d89d6b9ad757460a92c5dc79
2 changes: 1 addition & 1 deletion src/Luminous.Application/DTOs/DeviceDto.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public sealed record LinkedDeviceDto
{
public DeviceDto Device { get; init; } = new();
public string AccessToken { get; init; } = string.Empty;
public string RefreshToken { get; init; } = string.Empty;
public string? RefreshToken { get; init; }
public string TokenType { get; init; } = "Bearer";
public int ExpiresIn { get; init; }
}
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public async Task<LinkedDeviceDto> Handle(LinkDeviceCommand request, Cancellatio
// Verify link code is still valid
if (!device.IsLinkCodeValid)
{
throw new ValidationException([new FluentValidation.Results.ValidationFailure(
throw new FluentValidation.ValidationException([new FluentValidation.Results.ValidationFailure(
"LinkCode", "Link code has expired. Please generate a new code.")]);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public async Task<DeviceHeartbeatDto> Handle(RecordHeartbeatCommand request, Can

if (!device.IsLinked)
{
throw new ValidationException([new FluentValidation.Results.ValidationFailure(
throw new FluentValidation.ValidationException([new FluentValidation.Results.ValidationFailure(
"DeviceId", "Device is not linked to any family.")]);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public async Task<Unit> Handle(UnlinkDeviceCommand request, CancellationToken ca

if (!device.IsLinked)
{
throw new ValidationException([new FluentValidation.Results.ValidationFailure(
throw new FluentValidation.ValidationException([new FluentValidation.Results.ValidationFailure(
"DeviceId", "Device is not linked to any family.")]);
}

Expand Down
Loading