res.redirect('back') with parameters

后端 未结 7 1998
刺人心
刺人心 2020-12-23 09:44

I have a register form on every page of my website. During registration some error may occur. After catching the error, I have to return the user to the previous page, sho

7条回答
  •  感情败类
    2020-12-23 10:18

    You should add page parameter to the form. Then you can read it on the server and use it for the redirect.

    res.redirect(page, {reg_error:'username'}) // page being the url to redirect to.
    

提交回复
热议问题