NodeJS & Express authentication middleware not functioning correctly
问题 I am attempting to run the function isUserAuthenticated on every request to the server by requiring it in app.js and 'using' it as so: app.use(authenticate.isUserAuthenticated) . I have an /authenticate callback route that is being POSTED to by our SAML Identity Provider which contains the information required to validate the user and the session. This is what is inside my authenticate.js file: module.exports = router; module.exports.isUserAuthenticated = function(req, res, next) { console