diff --git a/Yavsc/ApiController/GCMController.cs b/Yavsc/ApiController/GCMController.cs index 848133a4..10f817b9 100644 --- a/Yavsc/ApiController/GCMController.cs +++ b/Yavsc/ApiController/GCMController.cs @@ -35,10 +35,8 @@ public class GCMController : Controller if (_context.GCMDevices.Any(d => d.DeviceId == declaration.DeviceId)) { var alreadyRegisteredDevice = _context.GCMDevices.FirstOrDefault(d => d.DeviceId == declaration.DeviceId); - if (alreadyRegisteredDevice.DeviceOwnerId != uid) - { - return new BadRequestObjectResult(new { error = $"Device owned by someone else {declaration.DeviceId}" }); - } + // Override an exiting owner + alreadyRegisteredDevice.DeviceOwnerId = uid; alreadyRegisteredDevice.GCMRegistrationId = declaration.GCMRegistrationId; alreadyRegisteredDevice.Model = declaration.Model; alreadyRegisteredDevice.Platform = declaration.Platform;