mirror of
https://github.com/bitwarden/server.git
synced 2025-04-09 07:08:15 -05:00
more relay logging
This commit is contained in:
parent
dc0bdfa28b
commit
2f3b38a941
@ -54,12 +54,15 @@ namespace Bit.Core.Services
|
||||
|
||||
protected async Task SendAsync(HttpMethod method, string path, object requestModel = null)
|
||||
{
|
||||
_logger.LogInformation(Constants.BypassFiltersEventId, "SendAsync1");
|
||||
var tokenStateResponse = await HandleTokenStateAsync();
|
||||
if(!tokenStateResponse)
|
||||
{
|
||||
_logger.LogInformation(Constants.BypassFiltersEventId, "SendAsync2");
|
||||
return;
|
||||
}
|
||||
|
||||
_logger.LogInformation(Constants.BypassFiltersEventId, "SendAsync3");
|
||||
var message = new TokenHttpRequestMessage(requestModel, AccessToken)
|
||||
{
|
||||
Method = method,
|
||||
|
@ -73,6 +73,7 @@ namespace Bit.Core.Services
|
||||
RevisionDate = cipher.RevisionDate,
|
||||
};
|
||||
|
||||
_logger.LogInformation(Constants.BypassFiltersEventId, "Relay PushCipherAsync");
|
||||
await SendPayloadToUserAsync(cipher.UserId.Value, type, message, true);
|
||||
}
|
||||
}
|
||||
@ -142,14 +143,17 @@ namespace Bit.Core.Services
|
||||
|
||||
private async Task SendPayloadToUserAsync(Guid userId, PushType type, object payload, bool excludeCurrentContext)
|
||||
{
|
||||
_logger.LogInformation(Constants.BypassFiltersEventId, "Relay SendPayloadToUserAsync1");
|
||||
var request = new PushSendRequestModel
|
||||
{
|
||||
UserId = userId.ToString(),
|
||||
Type = type,
|
||||
Payload = payload
|
||||
};
|
||||
|
||||
|
||||
_logger.LogInformation(Constants.BypassFiltersEventId, "Relay SendPayloadToUserAsync2");
|
||||
await AddCurrentContextAsync(request, excludeCurrentContext);
|
||||
_logger.LogInformation(Constants.BypassFiltersEventId, "Relay SendPayloadToUserAsync3");
|
||||
await SendAsync(HttpMethod.Post, "push/send", request);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user