Fix: fix Gon variables are not available on user_confirmation page
Related MR on Jihu
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
No UI changes
Before | After |
---|---|
How to set up and validate locally
- Given reCAPTCHA enabled
- And a user without logging in
- When goto
http://{{YOURHOST}/users/confirmation
- And fill with your email
- And submit the form without solve reCAPTCHA
- And after the page is loaded
- Then you should see an error message
- When solve the reCAPTCHA
- And submit the form
- Then the new email should be sent
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.
/cc @prajnamas