Switched from self created static constant json options to a source generator options
This commit is contained in:
@@ -3,6 +3,8 @@ using System.Net.Http.Json;
|
||||
using System.Security.Claims;
|
||||
using Microsoft.AspNetCore.Components.Authorization;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Microsoft.VisualBasic;
|
||||
using Moonlight.Shared.Http;
|
||||
using Moonlight.Shared.Http.Responses.Admin.Auth;
|
||||
|
||||
namespace Moonlight.Frontend.Services;
|
||||
@@ -23,7 +25,7 @@ public class RemoteAuthProvider : AuthenticationStateProvider
|
||||
try
|
||||
{
|
||||
var claimResponses = await HttpClient.GetFromJsonAsync<ClaimDto[]>(
|
||||
"api/auth/claims", Constants.SerializerOptions
|
||||
"api/auth/claims", SerializationContext.Default.Options
|
||||
);
|
||||
|
||||
var claims = claimResponses!.Select(claim => new Claim(claim.Type, claim.Value));
|
||||
|
||||
Reference in New Issue
Block a user