Closed
Description
Describe the bug
GetAuthenticationStateAsync throws an InvalidOperationException with the message:
'GetAuthenticationStateAsync was called before SetAuthenticationState.'
I do not know if this is an actual bug or just a lack of documentation on its correct use.
To Reproduce
Inject a ServerAuthenticationStateProvider
into a page. Then call 'GetAuthenticationStateAsync
in any of its async-events.
Further technical details
<PackageReference Include="Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore" Version="3.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="3.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Identity.UI" Version="3.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="3.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="3.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="3.0.0" />
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="3.0.0" />