Skip to content

Fix: add Gon variables to confirmations

Martin Tan请求将fix/resend-email-captcha合并到main-jh

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

Screenshots or screen recordings

Before After
image image

How to set up and validate locally

  1. Given Captcha 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 captcha
  6. And after the page is loaded
  7. And click on "点击完成身份验证"
  8. 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.

Martin Tan 编辑于

合并请求报告