1
0
mirror of https://github.com/bitwarden/server.git synced 2024-11-21 12:05:42 +01:00

[PM-11749] Add device type to device trust loss logging (#4742)

* Add device type to trust loss logging.

* Added check for null.
This commit is contained in:
Todd Martin 2024-09-06 18:06:39 -04:00 committed by GitHub
parent dd6bc89b19
commit ebf8bc0b85
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -252,8 +252,14 @@ public class DevicesController : Controller
throw new BadRequestException("Please provide a device identifier"); 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, var deviceType = _currentContext.DeviceType;
deviceId); 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);
} }
} }