Move the configuration of express static before customMiddleware. To prevent multiple calls of passport deserializeUser in static files. https://github.com/jaredhanson/passport/issues/14#issuecomment-4863459