Sfoglia il codice sorgente

Merge pull request #6502 from overleaf/jpa-skip-likely-failing-login-request

[web] skip login re-try request when no captcha response was generated

GitOrigin-RevId: 9edc6e8394914a710020983fe9cbcf09d543a82f
Jakob Ackermann 4 anni fa
parent
commit
3730672c97

+ 3 - 0
services/web/frontend/js/features/form-helpers/hydrate-form.js

@@ -33,6 +33,9 @@ function formSubmitHelper(formEl) {
         ) {
         ) {
           // Trigger captcha unconditionally.
           // Trigger captcha unconditionally.
           const captchaResponse = await validateCaptchaV2()
           const captchaResponse = await validateCaptchaV2()
+          if (!captchaResponse) {
+            throw e
+          }
           data = await sendFormRequest(formEl, captchaResponse)
           data = await sendFormRequest(formEl, captchaResponse)
         } else {
         } else {
           throw e
           throw e