jaredhanson / passport-local

Username and password authentication strategy for Passport and Node.js.
https://www.passportjs.org/packages/passport-local/?utm_source=github&utm_medium=referral&utm_campaign=passport-local&utm_content=about
MIT License
2.74k stars 498 forks source link

Is it possible to overwrite req.user? #115

Open hariawan opened 9 years ago

hariawan commented 9 years ago

This is the scenario,

Once I update my vendor document, I also want my req.user be updated.

I try this code

Vendor.updateById(id, data, function(err, newVendor) {
  req.user.vendor = newVendor
})

But I won't work. Any Idea?