How to test a custom AuthenticationStateProvider? #1666
-
|
I have a page with the following code: The CustomStateProvideris set in program.cs:
I'm gettin the following error: I have set the test authorization with: Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
|
Hey @TDroogers It seems you are missing the same registration you did in your |
Beta Was this translation helpful? Give feedback.
I am so blind:
This will ask for a
CustomStateProviderbut you didn't directly register one. You told the container only to provideCustomStateProviderif someone asks for aAuthenticationStateProvider.That said, you can easily fix your issue by:
Alternatively, you register
CustomStateProvideradditionally in the container: