mirror of
https://github.com/bitwarden/server.git
synced 2025-07-06 18:42:49 -05:00
rename hub to notifications
This commit is contained in:
27
src/Notifications/Controllers/NotificationsController.cs
Normal file
27
src/Notifications/Controllers/NotificationsController.cs
Normal file
@ -0,0 +1,27 @@
|
||||
using System.Threading.Tasks;
|
||||
using Bit.Core.Models;
|
||||
using Bit.Core.Utilities;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.SignalR;
|
||||
|
||||
namespace Bit.Notifications
|
||||
{
|
||||
[Authorize("Internal")]
|
||||
[SelfHosted(SelfHostedOnly = true)]
|
||||
public class NotificationsController : Controller
|
||||
{
|
||||
private readonly IHubContext<NotificationsHub> _hubContext;
|
||||
|
||||
public NotificationsController(IHubContext<NotificationsHub> hubContext)
|
||||
{
|
||||
_hubContext = hubContext;
|
||||
}
|
||||
|
||||
[HttpPost("~/notifications")]
|
||||
public async Task PostNotification([FromBody]PushNotificationData<object> model)
|
||||
{
|
||||
await HubHelpers.SendNotificationToHubAsync(model, _hubContext);
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user