Unknown authentication strategy "jwt" when use Request Scope Service
See original GitHub issueI’m submitting a…
[ ] Regression
[X] Bug report
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead post your question on Stack Overflow.
Current behavior
When i import in JwtStrategy a service that has Request Scope, authentication does not work anymore, as i show in this repository: https://github.com/victorschinaider/nest-request-auth-bug.
Expected behavior
I expect that i can use request scope service in JwtStrategy.
Minimal reproduction of the problem with instructions
In repository: https://github.com/victorschinaider/nest-request-auth-bug
What is the motivation / use case for changing the behavior?
Environment
Nest version: 6.0.0
For Tooling issues:
- Node version: 11
- Platform: Ubuntu
Others:
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:10 (2 by maintainers)
Top Results From Across the Web
I tried to add request scope in to provider but it will give Error
mongoose - I tried to add request scope in to provider but it will give Error: Unknown authentication strategy "jwt" - Stack Overflow....
Read more >Unknown authentication strategy "jwt" when I inject ... - Reddit
I have a user service that handles registration and login. But each time I inject another servie I get "Unknown authentication strategy "jwt"....
Read more >Unknown authentication strategy "jwt" nestjs - You.com
Coming back to this answer about a year and a half later, it looks like the real issue is the use of a...
Read more >Authentication | NestJS - A progressive Node.js framework
ignoreExpiration : just to be explicit, we choose the default false setting, which delegates the responsibility of ensuring that a JWT has not...
Read more >Nest.js Step-by-Step: Part 3 (Users and Authentication)
What actually happens is that the JWT Strategy extracts the token and validates it. If the token is invalid, the current Request is...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Is a more flexible
@nestjs/authpackage on the roadmap? @kamilmysliwiec Had to do some annoying workarounds with middleware and request context to get this working 💯Documentation at https://docs.nestjs.com/techniques/authentication should probably be updated to make this issue clear.