When I do this:
app.post('/account', function(req, res){
// attempt to validate input and insert user into db
signUpUser(req.body, function(success){
if(success){
// validation and sign up process successful - send to account page
res.redirect(302, '/account');
}else{
// validation or something else failed - redirect to register page
// and ask them to try again
res.redirect(422, '/register');
}
};
})
the 302
redirect works just fine, but the 422
redirect sends the user to a page which just reads
How do I stop it doing this? I don't want to display a page that requires the user to click on the link to where it's going, I want it just to go there. I can use a 302
code response instead, but 422
is a more accurate description of what's going on.
Any ideas? Thanks a lot