CascadingAuthenticationState error #684
ProjectFoxx
started this conversation in
General
Replies: 2 comments 2 replies
|
Hey @ProjectFoxx can you post the whole test and component? |
0 replies
|
This are the test and component Test Page: `@inject IModalService Modal @page "/articles" StandardPageLayout> AddArticle() |
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Hello all,
I hope you guys can help me with this error.
I have an error when i am rendering a page. I get a CascadingAuthenticationState error:
System.InvalidOperationException : Cannot resolve scoped service 'Microsoft.AspNetCore.Components.Authorization.CascadingAuthenticationState' from root provider. How can i fix this?
I already read this: https://bunit.dev/docs/test-doubles/faking-auth.html
I already did this
using var ctx = new TestContext();
TestAuthorizationContext authContext = ctx.AddTestAuthorization();
authContext.SetAuthorized("sffsdf.fsffe.com", AuthorizationState.Authorized);
authContext.SetRoles("Administrator");
But still get this error how can i fix this?
All reactions