using Microsoft.AspNetCore.SignalR; using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using MisIngredientesVue.Core.Extensions; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Authentication.JwtBearer; namespace MisIngredientesVue.Hubs { [Authorize(AuthenticationSchemes = JwtBearerDefaults.AuthenticationScheme)] public class ApiCallNotificationHub : Hub { public override async Task OnConnectedAsync() { await Groups.AddToGroupAsync(Context.ConnectionId, Context.User.Identity.GetTenantId()); await base.OnConnectedAsync(); } public override async Task OnDisconnectedAsync(Exception ex) { await Groups.RemoveFromGroupAsync(Context.ConnectionId, Context.User.Identity.GetTenantId()); await base.OnDisconnectedAsync(ex); } } }