Skip to content

Commit 45352f9

Browse files
committed
[FIX] website_cf_turnstile: no turnstile on extra step
Scenario: - enable extra step in website ecommerce - enable turnstile - do the checkout process until after "extra step" step - go check the sale order Result: there is a big "turnstile_captcha: {1000 character hash}" that is logged each time the customer filled the "extra step" step. Cause: turnstile if enabled is activated for all website_form and will add a turnstile_captcha parameter. For other website.form, the captcha is removed from the params when calling: request.env['ir.http']._verify_request_recaptcha_token('website_form') but the custom route /website/form/shop.sale.order doesn't do that so the captcha is logged in note. Fix: Recaptcha is already disabled on the extra_step with the class: s_website_form_no_recaptcha, so it makes sense to just have the same behavior for turnstile. opw-4934132 closes odoo#219558 X-original-commit: 9b44212 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com> Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
1 parent bc675ff commit 45352f9

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

  • addons/website_cf_turnstile/static/src/interactions

addons/website_cf_turnstile/static/src/interactions/form.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,9 @@ patch(Form.prototype, {
1313
super.start();
1414
TurnStile.clean(this.el);
1515
if (
16-
!this.el.querySelector(".s_turnstile")
17-
&& session.turnstile_site_key
16+
!this.el.classList.contains("s_website_form_no_recaptcha") &&
17+
!this.el.querySelector(".s_turnstile") &&
18+
session.turnstile_site_key
1819
) {
1920
this.uniq = uniqueId("turnstile_");
2021
this.el.classList.add(this.uniq);

0 commit comments

Comments
 (0)