Skip to content

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' to redirect_to action: 'new'

Screenshots or screen recordings

No UI changes

Before After
image image

How to set up and validate locally

  1. Given reCAPTCHA enabled
  2. And a user without logging in
  3. When goto http://{{YOURHOST}/users/confirmation
  4. And fill with your email
  5. And submit the form without solve reCAPTCHA
  6. And after the page is loaded
  7. Then you should see an error message
  8. When solve the reCAPTCHA
  9. And submit the form
  10. 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.

/cc @prajnamas

Edited by ARCHIVED - Martin Tan

Merge request reports