mirror of
https://github.com/bitwarden/server.git
synced 2025-07-01 16:12:49 -05:00
hub api notifications
This commit is contained in:
@ -143,7 +143,7 @@ namespace Bit.Core.Services
|
||||
ExcludeCurrentContext(request);
|
||||
}
|
||||
|
||||
await SendAsync(request);
|
||||
await SendAsync(HttpMethod.Post, "/push/send", request);
|
||||
}
|
||||
|
||||
private async Task SendPayloadToOrganizationAsync(Guid orgId, PushType type, object payload, bool excludeCurrentContext)
|
||||
@ -160,31 +160,7 @@ namespace Bit.Core.Services
|
||||
ExcludeCurrentContext(request);
|
||||
}
|
||||
|
||||
await SendAsync(request);
|
||||
}
|
||||
|
||||
private async Task SendAsync(PushSendRequestModel requestModel)
|
||||
{
|
||||
var tokenStateResponse = await HandleTokenStateAsync();
|
||||
if(!tokenStateResponse)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var message = new TokenHttpRequestMessage(requestModel, AccessToken)
|
||||
{
|
||||
Method = HttpMethod.Post,
|
||||
RequestUri = new Uri(string.Concat(Client.BaseAddress, "/push/send"))
|
||||
};
|
||||
|
||||
try
|
||||
{
|
||||
await Client.SendAsync(message);
|
||||
}
|
||||
catch(Exception e)
|
||||
{
|
||||
_logger.LogError(12334, e, "Unable to send push notification.");
|
||||
}
|
||||
await SendAsync(HttpMethod.Post, "/push/send", request);
|
||||
}
|
||||
|
||||
private void ExcludeCurrentContext(PushSendRequestModel request)
|
||||
|
Reference in New Issue
Block a user