NodeJS + Express: res.redirect('back'); with params

Posted by Ilya Rusanen on Stack Overflow See other posts from Stack Overflow or by Ilya Rusanen
Published on 2012-09-15T21:27:54Z Indexed on 2012/09/15 21:37 UTC
Read the original article Hit count: 166

Filed under:
|
|

I have register form on every page of my website. During registration some error may occur. After cathing error, I have to return user to previous page, showing some error tips. The problem is I dont know from which page user performs registration. That's why I use res.redirect('back');. However, I cant just redirect user back, I have to show him whats wrong. Thats why I have to pass some parameter. But res.redirect('back', (reg_error:'username')}) can not be used directly 'cause res.redirect() doesn't support parameters. How can I render prevous page with some parameter? Thanks!

© Stack Overflow or respective owner

Related posts about node.js

Related posts about redirect