1
0
mirror of https://github.com/bitwarden/server.git synced 2025-07-04 17:42:49 -05:00

[Provider] Add support for events (#1447)

This commit is contained in:
Oscar Hinton
2021-07-15 16:37:27 +02:00
committed by GitHub
parent 8ac2dc50af
commit f6ebb20847
74 changed files with 4007 additions and 635 deletions

View File

@ -10,21 +10,21 @@ namespace Bit.Notifications
[Authorize("Application")]
public class NotificationsHub : Microsoft.AspNetCore.SignalR.Hub
{
private readonly IProviderOrganizationRepository _providerOrganizationRepository;
private readonly IProviderUserRepository _providerUserRepository;
private readonly ConnectionCounter _connectionCounter;
private readonly GlobalSettings _globalSettings;
public NotificationsHub(IProviderOrganizationRepository providerOrganizationRepository,
public NotificationsHub(IProviderUserRepository providerUserRepository,
ConnectionCounter connectionCounter, GlobalSettings globalSettings)
{
_providerOrganizationRepository = providerOrganizationRepository;
_providerUserRepository = providerUserRepository;
_connectionCounter = connectionCounter;
_globalSettings = globalSettings;
}
public override async Task OnConnectedAsync()
{
var currentContext = new CurrentContext(_providerOrganizationRepository);
var currentContext = new CurrentContext(_providerUserRepository);
await currentContext.BuildAsync(Context.User, _globalSettings);
if (currentContext.Organizations != null)
{
@ -39,7 +39,7 @@ namespace Bit.Notifications
public override async Task OnDisconnectedAsync(Exception exception)
{
var currentContext = new CurrentContext(_providerOrganizationRepository);
var currentContext = new CurrentContext(_providerUserRepository);
await currentContext.BuildAsync(Context.User, _globalSettings);
if (currentContext.Organizations != null)
{