Skip to content

Commit

Permalink
kjekt
Browse files Browse the repository at this point in the history
  • Loading branch information
oskogstad committed Nov 25, 2024
1 parent 8e0ede7 commit 9055ae7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 11 deletions.
12 changes: 2 additions & 10 deletions src/Digdir.Domain.Dialogporten.GraphQL/EndUser/PartyQueries.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
using System.Text.Json;
using System.Text.Json.Serialization;
using AutoMapper;
using Digdir.Domain.Dialogporten.Application.Common.Extensions;
using Digdir.Domain.Dialogporten.Application.Externals.Presentation;
Expand All @@ -11,12 +9,6 @@ namespace Digdir.Domain.Dialogporten.GraphQL.EndUser;

public partial class Queries
{
private static readonly JsonSerializerOptions SerializerOptions = new()
{
PropertyNameCaseInsensitive = true,
DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingDefault
};

public async Task<List<AuthorizedParty>> GetParties(
[Service] ISender mediator,
[Service] IMapper mapper,
Expand All @@ -28,8 +20,8 @@ public async Task<List<AuthorizedParty>> GetParties(
var result = await mediator.Send(request, cancellationToken);

user.GetPrincipal().TryGetPid(out var pid);
logger.LogInformation("GraphQL handler, app result for party {Party}: {AuthorizedParties}",
pid, JsonSerializer.Serialize(result, SerializerOptions));
logger.LogInformation("GraphQL handler, app result for party {Party}: {@Result}",
pid, result);

return mapper.Map<List<AuthorizedParty>>(result.AuthorizedParties);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public async Task<AuthorizedPartiesResult> GetAuthorizedParties(IPartyIdentifier
=> await PerformAuthorizedPartiesRequest(authorizedPartiesRequest, token), token: cancellationToken);

// Temporary logging to debug missing authorized sub parties
_logger.LogInformation("Authorized parties for {Party}: {AuthorizedParties}", authenticatedParty, JsonSerializer.Serialize(authorizedParties, SerializerOptions));
_logger.LogInformation("Authorized parties for {Party}: {@AuthorizedParties}", authenticatedParty, authorizedParties);

return flatten ? GetFlattenedAuthorizedParties(authorizedParties) : authorizedParties;
}
Expand Down

0 comments on commit 9055ae7

Please sign in to comment.