✅ IServiceCollection.Confgure<> not working
In first line it's properly building
JWTConfiguration
instance, but for some reason it seems to be unable in below one as DI doesn't work in controller. Don't want to use singleton as it will make me unable to modify secret in middle. Was unable to find if by any chance there is different method to pick configuration from secret.json
as well8 Replies
Why would you be using builder in controller
I am not
Use IOptions
oh
totally forgot about that
thank you
And there are snapshot variants that watch for changes as well
that would be if I added JWTConfiguration as scoped and did make such constructor for it?
Options pattern - .NET
Learn the options pattern to represent groups of related settings in .NET apps. The options pattern uses classes to provide strongly-typed access to settings.
thank you