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

Handle rejection not found in docs #11

Open
msolano00 opened this issue May 24, 2018 · 1 comment
Open

Handle rejection not found in docs #11

msolano00 opened this issue May 24, 2018 · 1 comment

Comments

@msolano00
Copy link

msolano00 commented May 24, 2018

The provided example is missing the user-not-found handler:

passport.use(new CustomStrategy(
  function(req, done) {
    User.findOne({
      username: req.body.username
    }, function (err, user) {
      done(err, user);
    });
  }
));

I understand that this is already stated in other strategies but it would be great to have something like:

passport.use(new CustomStrategy(
  function(req, done) {
    User.findOne({
      username: req.body.username
    }, function (err, user) {
      if (typeof user !== 'undefined' && user) done(err, user);
      else done(err, false);    // <- This
    });
  }
));
@msolano00 msolano00 changed the title Handle users not found Handle rejection not found in docs May 24, 2018
@mbell8903
Copy link
Owner

Go ahead and add a PR for the docs update!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants