I have a login form /login that posts the login info to /checklogin. If the credentials are incorrect, I want to redirect the user to /login with an error message along the lines of "incorrect username or password". However, I can't seem to figure out how to pass an option through res.redirect like you would using res.render.
What's the best way of doing this? I saw a prior question asked about this, but it doesn't seem to work in the later versions of Express.