Skip to content

Commit 9c5525e

Browse files
committed
Updates
1 parent 0be9c72 commit 9c5525e

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

aspnetcore/blazor/security/webassembly/standalone-with-identity/qrcodes-for-authenticator-apps.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,15 @@ At the top of the `CookieAuthenticationStateProvider.cs` file, add a `using` sta
160160
using System.Text.Json.Serialization;
161161
```
162162

163+
Inject an `ILogger<CookieAuthenticationStateProvider>` to log exceptions in the class:
164+
165+
```diff
166+
- public class CookieAuthenticationStateProvider(IHttpClientFactory httpClientFactory)
167+
- : AuthenticationStateProvider, IAccountManagement
168+
+ public class CookieAuthenticationStateProvider(IHttpClientFactory httpClientFactory, ILogger<CookieAuthenticationStateProvider> logger)
169+
+ : AuthenticationStateProvider, IAccountManagement
170+
```
171+
163172
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:
164173

165174
```diff

0 commit comments

Comments
 (0)