Advertisement
Guest User

Untitled

a guest
Oct 21st, 2019
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.24 KB | None | 0 0
  1. passport.deserializeUser(async function(id, done){
  2. try{
  3. const user = await User.findById(id);
  4.  
  5. if(!user)
  6. throw new Error("User session not found")
  7.  
  8. done(null, user)
  9. }catch(e){
  10. done(e)
  11. }
  12. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement