Added signalR logout

This commit is contained in:
Lucio Maranta
2018-01-31 10:20:23 +01:00
parent b25eba3b95
commit 75feaa63f4
+5 -1
View File
@@ -8,6 +8,8 @@ using System.Linq;
using static Step.Utils.LanguageController;
using Step.Model.DTOModels;
using System.Globalization;
using Microsoft.AspNet.SignalR;
using Step.Controllers.SignalR;
namespace Step.Controllers.WebApi
{
@@ -33,7 +35,9 @@ namespace Step.Controllers.WebApi
// Delete all the user session on the machine
sessionsController.DeleteSessionsByUserAndMachineId(Convert.ToInt32(machineId.Value), Convert.ToInt32(userId.Value));
}
// Send to the clients the id of the disconnected user
var context = GlobalHost.ConnectionManager.GetHubContext<NcHub>();
context.Clients.All.logout(new { id = userId.Value });
return Ok();
}