Why is passport.deserializeUser called after req.user has been restored?
问题 According to the Passport Documentation on Sessions ...only the user ID is serialized to the session, keeping the amount of data stored within the session small. When subsequent requests are received, this ID is used to find the user, which will be restored to req.user. However my test SPA which is based on Passport form-based authentication sample with debug messages added indicates req.user has already been restored before the app.get route handler is triggered. Here is the output from an