Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -160,16 +160,6 @@ At the top of the `CookieAuthenticationStateProvider.cs` file, add a `using` sta
using System.Text.Json.Serialization;
```

Inject an `ILogger<CookieAuthenticationStateProvider>` to log exceptions in the class:

```diff
- public class CookieAuthenticationStateProvider(IHttpClientFactory httpClientFactory)
- : AuthenticationStateProvider, IAccountManagement
+ public class CookieAuthenticationStateProvider(IHttpClientFactory httpClientFactory,
+ ILogger<CookieAuthenticationStateProvider> logger)
+ : AuthenticationStateProvider, IAccountManagement
```

In the <xref:System.Text.Json.JsonSerializerOptions>, add the <xref:System.Text.Json.JsonSerializerOptions.DefaultIgnoreCondition> option set to <xref:System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull?displayProperty=nameWithType>, which avoids serializing null properties:

```diff
Expand Down