New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error: Unknown authentication strategy "jwt" for Project with multi apps projects #13282
Comments
Any help here? |
Please provide a minimum reproduction repository. You can start one by running why reproductions are required |
it's dine, but how can i do? Any online tools to build nestjs application and share here? |
@thedarkknight197 you can use https://codesandbox.io or any other tool. Just share some full code ;) |
nest new jwt-reproduction
cd jwt-reproduction
# make code changes
git add .
git commit -m "feat: changes necessary for reproduction"
# make GitHub/GitLab repo
git remote add origin <origin>
git push |
I know how create a repo @jmcdo29 my question was about online tools, i have created a new repo for it! :D @micalevisk, @jmcdo29 i finded the problem: .env file is not readed by config module when use multi app structure if is placed inside apps/name-app/src folder. How is possible configure it? You can see the repo here: https://github.com/DigitalNextBusiness/working-jwt/tree/multi-app |
You can specify a custom env file path. Just keep in mind that I figured you knew how to make a repo, but honestly, a repo is usually the quickest and easiest way to share a reproduction as it also means immediate access to modify and tinker with as necessary in a familiar environment. Otherwise, Stackblitz and codesandbox do both work. |
Thank you for your support @jmcdo29 and your helpfullexplaination very apreciated! |
@jmcdo29 Is possible use a Passport Strategy with Scoped Request?
My backend is a multitenancy prisma connection with db. this is my user service code:
Same request here: #1870 |
@jmcdo29 i have updated the code in this way as menthioned in the doc you posted, could you control it?
|
Is there an existing issue for this?
Current behavior
Hello i have creared a nest projects and registered some apps now my folders look like:
the passport and jwt strategy at this time is used only by one app. so i installed globally the dependencies
app.module.ts
auth module:
user module:
jwt strategy:
jwt auth guard
Minimum reproduction code
not have
Steps to reproduce
No response
Expected behavior
creating a normal project with this import structure no error show. what is wrong in my previus configuration?
app module:
auth module:
user module:
jwt strategy (is only a test)
jwt auth guard
Package
@nestjs/common
@nestjs/core
@nestjs/microservices
@nestjs/platform-express
@nestjs/platform-fastify
@nestjs/platform-socket.io
@nestjs/platform-ws
@nestjs/testing
@nestjs/websockets
Other package
@nestjs/jwt
NestJS version
10.2.0
Packages versions
Node.js version
20.11.0
In which operating systems have you tested?
Other
if could help:
I readed: #1868
and https://stackoverflow.com/questions/60405308/nestjs-passport-jwt-unknown-strategy
The text was updated successfully, but these errors were encountered: