Skip to content

docs: modernize Mongoose examples using async/await#1054

Open
Vikash9546 wants to merge 1 commit intojaredhanson:masterfrom
Vikash9546:fix-1046
Open

docs: modernize Mongoose examples using async/await#1054
Vikash9546 wants to merge 1 commit intojaredhanson:masterfrom
Vikash9546:fix-1046

Conversation

@Vikash9546
Copy link
Copy Markdown

This PR updates the Mongoose examples in the README.md. As of Mongoose 7.x+, Model.findOne() and Model.findById() no longer accept callbacks. The documentation examples have been updated to use modern async/await syntax to prevent confusion for new users setting up Passport alongside modern Mongoose.

Changes Made

  • Updated the LocalStrategy example in the Strategies section to use a try...catch block with await User.findOne().
  • Updated the passport.deserializeUser example in the Sessions section to use a try...catch block with await User.findById().

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

Successfully merging this pull request may close these issues.

1 participant