Fix: add Gon variables to confirmations
related issue #1071 (closed)
upstream MR and it's duplicated with Sets Gon variables in response to requests with invalid reCAPTCHA
why?
JH Captcha is not working on users/confirmation
page when trying to resend email confirmation due to the Gon variables are not available on the create
action of ConfirmationsController
after form submit.
This render action: 'new' only renders views without running any code in that action, that's why the Gon variables are not shown according to Rails docs.
This change will effect the create
action of two controllers since the check_recaptcha
method are used in app/controllers/passwords_controller.rb and app/controllers/confirmations_controller.rb.
What does this MR do
-
Change render action: 'new'
toredirect_to action: 'new'
Screenshots or screen recordings
Before | After |
---|---|
How to set up and validate locally
- Given Captcha enabled
- And a user without logging in
- When goto
http://{{YOURHOST}/users/confirmation
- And fill with your email
- And submit the form without solve captcha
- And after the page is loaded
- And click on "点击完成身份验证"
- Then Tencent Captcha should pop out
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.