Skip to content
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

Using custom passport from a different package causes error #876

Closed
2 of 4 tasks
danielyag opened this issue Apr 25, 2022 · 1 comment
Closed
2 of 4 tasks

Using custom passport from a different package causes error #876

danielyag opened this issue Apr 25, 2022 · 1 comment
Labels
bug Something isn't working needs triage

Comments

@danielyag
Copy link

danielyag commented Apr 25, 2022

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

  1. cd packages/shared
  2. npm i
  3. npm run build
  4. cd ../packages/server
  5. npm i
  6. npm run start:dev
  7. curl -i 'localhost:3000' (internal server error)
  8. 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

@danielyag danielyag added bug Something isn't working needs triage labels Apr 25, 2022
@kamilmysliwiec
Copy link
Member

Please, use our Discord channel (support) for such questions. We are using GitHub to track bugs, feature requests, and potential improvements.

@nestjs nestjs locked and limited conversation to collaborators May 5, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working needs triage
Projects
None yet
Development

No branches or pull requests

2 participants