From 17a624c8ddacc1dac4904793645d6c893f7ced77 Mon Sep 17 00:00:00 2001 From: Roy Ben Shabat Date: Thu, 24 Sep 2020 23:20:25 +0300 Subject: Changed all PPC updated to based on GUID ! --- .../Web/Tango.MachineService/Controllers/PPCController.cs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'Software/Visual_Studio/Web/Tango.MachineService') diff --git a/Software/Visual_Studio/Web/Tango.MachineService/Controllers/PPCController.cs b/Software/Visual_Studio/Web/Tango.MachineService/Controllers/PPCController.cs index 4215cd175..601438d67 100644 --- a/Software/Visual_Studio/Web/Tango.MachineService/Controllers/PPCController.cs +++ b/Software/Visual_Studio/Web/Tango.MachineService/Controllers/PPCController.cs @@ -390,7 +390,11 @@ namespace Tango.MachineService.Controllers if (hasDatabaseUpdates) { response.IsDatabaseUpdateAvailable = true; - response.UpdateDBResponse = UpdateDB(new UpdateDBRequest() { SerialNumber = request.SerialNumber }); + response.UpdateDBResponse = UpdateDB(new UpdateDBRequest() + { + ApplicationVersion = request.Version, + FirmwareVersion = request.FirmwareVersion + }); } //Compare database @@ -937,11 +941,11 @@ namespace Tango.MachineService.Controllers } else if (request.Mode == LoginMode.Machine) { - var machine = db.Machines.SingleOrDefault(x => x.SerialNumber == request.SerialNumber); + var machine = db.Machines.SingleOrDefault(x => x.SerialNumber == request.SerialNumber || x.Guid == request.MachineGuid); if (machine == null) { - throw new AuthenticationException("Invalid serial number."); + throw new AuthenticationException("Invalid machine serial number or id."); } response.AccessToken = WebToken.CreateNew(MachineServiceConfig.JWT_TOKEN_SECRET, new TokenObject() -- cgit v1.3.1