blazor-workshop
blazor-workshop copied to clipboard
Authentication issue
Hello.
I am using VS2022 with NET 7.0
I followed the workshop ok from 00-get-started up to 06-authentication.
I couldn't get the AuthorizeView component to show up properly (only showed the three dots).
Afte debugging, it turns out I need to explicitly add
[JsonSerializable(typeof(Dictionary<string,string>))]
to the list in Order.cs.
Otherwise, after the call to _configuration/{clientId}
the serializer returns null, resulting in the exception.
crit: Microsoft.AspNetCore.Components.WebAssembly.Rendering.WebAssemblyRenderer[100]
Unhandled exception rendering component: Could not load settings from '_configuration/BlazingPizza.Client'
createUserManager@https://localhost:5001/_content/Microsoft.AspNetCore.Components.WebAssembly.Authentication/AuthenticationService.js:2:290604
Microsoft.JSInterop.JSException: Could not load settings from '_configuration/BlazingPizza.Client'
createUserManager@https://localhost:5001/_content/Microsoft.AspNetCore.Components.WebAssembly.Authentication/AuthenticationService.js:2:290604
Regards, Miguel