Giter Club home page Giter Club logo

Comments (8)

engcom-Delta avatar engcom-Delta commented on July 22, 2024 1

With current recaptcha implementation we cannot add it to widget from Content->Pages, only from configuration for specific controllers
Mark this issue as Feature Request for further discussion

from security-package.

heldchen avatar heldchen commented on July 22, 2024

small preemptive clarification: on the /contact/index/index/ contact form itself, the recaptcha is working properly.

from security-package.

phoenix128 avatar phoenix128 commented on July 22, 2024

Hello @heldchen ,
the reCaptcha is injected via layout (see view/frontend/layout/contact_index_index.xml in the module).
So basically it will not be injected when directly using the contact form as a block. In this case I think you will need to use a custom phtml file like the following:

<div
    class="field-recaptcha"
    id="<?= /* @noEscape */ $block->getRecaptchaId() ?>-container"
    data-bind="scope:'<?= /* @noEscape */ $block->getRecaptchaId() ?>'"
>
    <!-- ko template: getTemplate() --><!-- /ko -->
</div>

<script type="text/x-magento-init">
{
    "#<?= /* @noEscape */ $block->getRecaptchaId() ?>-container": {
        "Magento_Ui/js/core/app": {
            "components":{
                "<?= /* @noEscape */ $block->getRecaptchaId() ?>":{
                    "component": "MSP_ReCaptcha\/js\/reCaptcha",
                    "zone": "create",
                    "settings": {
                        "siteKey": "<?= /* @noEscape */ $block->getPublicKey() ?>",
                        "size": "invisible",
                        "badge": "bottomright",
                        "theme": null,
                        "lang": null,
                        "enabled": {
                            "contact":true
                        }
                    },
                    "reCaptchaId":"<?= /* @noEscape */ $block->getRecaptchaId() ?>"
                }
            }
        }
    }
}
</script>

NOTE: I did not test it, so make a try before, you may need to adjust something.

from security-package.

heldchen avatar heldchen commented on July 22, 2024

@phoenix128 I know (and we have implemented it in a similar way), but ideally this should be injected by the recaptcha module into the contactform widget itself for everyone to use properly without having to manually reconstruct the initialization logic - after all, it currently breaks any page that has the core contact form widget in cms page and recaptcha enabled.

from security-package.

dvoskoboinikov avatar dvoskoboinikov commented on July 22, 2024

@magento export issue to Jira project MC as Story

from security-package.

github-jira-sync-bot avatar github-jira-sync-bot commented on July 22, 2024

Jira issue https://jira.corp.magento.com/browse/MC-42379 is successfully created for this GitHub issue.

from security-package.

nathanjosiah avatar nathanjosiah commented on July 22, 2024

There were some pre-requisites to this internally. This issue is currently pending a discussion.

from security-package.

nathanjosiah avatar nathanjosiah commented on July 22, 2024

We have ultimately decided not to work on this issue internally right now due to scheduling and commitment reasons. We may decide to do this in the future but for now we will close this issue. You are welcome to open a PR to fix this issue in which case I will happily reopen this.

from security-package.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.