mirror of
https://github.com/bitwarden/server.git
synced 2025-07-03 09:02:48 -05:00
Run formatting (#2230)
This commit is contained in:
@ -4,29 +4,28 @@ using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.SignalR;
|
||||
|
||||
namespace Bit.Notifications
|
||||
namespace Bit.Notifications;
|
||||
|
||||
[Authorize("Internal")]
|
||||
public class SendController : Controller
|
||||
{
|
||||
[Authorize("Internal")]
|
||||
public class SendController : Controller
|
||||
private readonly IHubContext<NotificationsHub> _hubContext;
|
||||
|
||||
public SendController(IHubContext<NotificationsHub> hubContext)
|
||||
{
|
||||
private readonly IHubContext<NotificationsHub> _hubContext;
|
||||
_hubContext = hubContext;
|
||||
}
|
||||
|
||||
public SendController(IHubContext<NotificationsHub> hubContext)
|
||||
[HttpPost("~/send")]
|
||||
[SelfHosted(SelfHostedOnly = true)]
|
||||
public async Task PostSend()
|
||||
{
|
||||
using (var reader = new StreamReader(Request.Body, Encoding.UTF8))
|
||||
{
|
||||
_hubContext = hubContext;
|
||||
}
|
||||
|
||||
[HttpPost("~/send")]
|
||||
[SelfHosted(SelfHostedOnly = true)]
|
||||
public async Task PostSend()
|
||||
{
|
||||
using (var reader = new StreamReader(Request.Body, Encoding.UTF8))
|
||||
var notificationJson = await reader.ReadToEndAsync();
|
||||
if (!string.IsNullOrWhiteSpace(notificationJson))
|
||||
{
|
||||
var notificationJson = await reader.ReadToEndAsync();
|
||||
if (!string.IsNullOrWhiteSpace(notificationJson))
|
||||
{
|
||||
await HubHelpers.SendNotificationToHubAsync(notificationJson, _hubContext);
|
||||
}
|
||||
await HubHelpers.SendNotificationToHubAsync(notificationJson, _hubContext);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user