Using custom passport from a different package causes error
danielyag opened this issue · 1 comments
danielyag commented
Is there an existing issue for this?
- I have searched the existing issues
Current behavior
I created a custom passport. I have multiple services under the same repo (monorepo), so I located the custom passport in a shared directory and I import it from there.
When providing wrong credential, instead of getting unauthorized exception, I'm getting internal server error.
Note: importing the package instead of installing - works fine.
Minimum reproduction code
https://github.com/danielyagodaev/custom-passport
Steps to reproduce
- cd packages/shared
- npm i
- npm run build
- cd ../packages/server
- npm i
- npm run start:dev
- curl -i 'localhost:3000' (internal server error)
- curl -i -H "secret:123" 'localhost:3000' (OK)
Expected behavior
When providing wrong credentials, I would expect getting 401 unauthorized error.
Package version
8.2.1
Passport version
0.5.2
NestJS version
8.4.4
Node.js version
16.14.2
In which operating systems have you tested?
- macOS
- Windows
- Linux
Other
No response
kamilmysliwiec commented
Please, use our Discord channel (support) for such questions. We are using GitHub to track bugs, feature requests, and potential improvements.