Coder Social home page Coder Social logo

overwhelmed by error logs about passport HOT 6 CLOSED

TrejGun avatar TrejGun commented on June 26, 2024
overwhelmed by error logs

from passport.

Comments (6)

kamilmysliwiec avatar kamilmysliwiec commented on June 26, 2024 2

Maybe we should change it from .error() to .debug() just so it's easy to turn it off (especially in prod)? 🤔

from passport.

kamilmysliwiec avatar kamilmysliwiec commented on June 26, 2024 2

Fixed in 9.0.3. If anyone needs more verbose logging they can just override the handleRequest method.

from passport.

sezanzeb avatar sezanzeb commented on June 26, 2024 2

I wish this was changed to .debug() instead. The proposed alternative of monkey-patching it is considered bad practice afaik...

Having to

  1. debug into passport
  2. patch a method of a third-party library, which potentially breaks with the next release, with the patch not even having access to authLogger

is very impractical. Please consider #1251 one more time, it was writing debug logs.

from passport.

sezanzeb avatar sezanzeb commented on June 26, 2024 2

If anyone needs more verbose logging they can just override the handleRequest method.

The proposed alternative of monkey-patching it is considered bad practice afaik...

I misunderstood this, handleRequest can be overwritten in the class inheriting from AuthGuard(...) as far as I can tell, no monkey-patch required.

I would still prefer a debug log which is there by default. Without your remark I wouldn't have realized that this can be overwritten in my own guard. I think I'll give it a try next week though in the meantime.

from passport.

TrejGun avatar TrejGun commented on June 26, 2024

thanks a lot

from passport.

kamilmysliwiec avatar kamilmysliwiec commented on June 26, 2024

This is documented here https://docs.nestjs.com/recipes/passport#extending-guards

from passport.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.