Skip to content

Commit

Permalink
[PM-11749] Add device type to device trust loss logging (#4742)
Browse files Browse the repository at this point in the history
* Add device type to trust loss logging.

* Added check for null.

(cherry picked from commit ebf8bc0)
  • Loading branch information
trmartin4 committed Sep 6, 2024
1 parent 5a1e410 commit 5403a16
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/Api/Controllers/DevicesController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -252,8 +252,14 @@ public void PostLostTrust()
throw new BadRequestException("Please provide a device identifier");
}

_logger.LogError("User {id} has a device key, but didn't receive decryption keys for device {device}", userId,
deviceId);
var deviceType = _currentContext.DeviceType;
if (deviceType == null)
{
throw new BadRequestException("Please provide a device type");
}

_logger.LogError("User {id} has a device key, but didn't receive decryption keys for device {device} of type {deviceType}", userId,
deviceId, deviceType);
}

}

0 comments on commit 5403a16

Please sign in to comment.