1
0
mirror of https://github.com/bitwarden/server.git synced 2025-07-16 15:17:33 -05:00

get request up from cloudflare header

This commit is contained in:
Kyle Spearrin
2019-01-25 00:01:24 -05:00
parent b19628c6f8
commit f8f7c339c3
3 changed files with 18 additions and 19 deletions

View File

@ -9,16 +9,18 @@ namespace Bit.Notifications
public class NotificationsHub : Microsoft.AspNetCore.SignalR.Hub
{
private readonly ConnectionCounter _connectionCounter;
private readonly GlobalSettings _globalSettings;
public NotificationsHub(ConnectionCounter connectionCounter)
public NotificationsHub(ConnectionCounter connectionCounter, GlobalSettings globalSettings)
{
_connectionCounter = connectionCounter;
_globalSettings = globalSettings;
}
public override async Task OnConnectedAsync()
{
var currentContext = new CurrentContext();
currentContext.Build(Context.User);
currentContext.Build(Context.User, _globalSettings);
if(currentContext.Organizations != null)
{
foreach(var org in currentContext.Organizations)
@ -33,7 +35,7 @@ namespace Bit.Notifications
public override async Task OnDisconnectedAsync(Exception exception)
{
var currentContext = new CurrentContext();
currentContext.Build(Context.User);
currentContext.Build(Context.User, _globalSettings);
if(currentContext.Organizations != null)
{
foreach(var org in currentContext.Organizations)