Remove google recaptcha from login modal
Only remove google recaptcha from login modal
9 Replies
Hey, can you give more info on the project you're using. It's not clear what exactly you need
@skirianov I have enabled Google Recaptcha in the. env configuration of VSF, but I want to not do Google verification in the login module. I found that Google verification is done in/node_ Modules/@vue-storefront/magento-api/server/index.js, and this js has been compressed, I don't know how to remove it
@Caroline You could try overriding the global config setting that LoginModal.vue is using.
The above is using your value from env, just set it to false and then it shouldn't be used for the Login.
@Darren R I have tried this method, but it will not display the Google recaptcha verification box on loginModal, but the interface will still request Google verification because const {secretkey}=context. config. recaptcha; Obtaining the configuration status in. env
You're right. I just looked in node_modules/@vue-storefront/magento-api/lib/index.server.js and it's checking config.recaptcha.isEnabled directly there.
It looks like setting it to true in env will enable for all the supported queries and you cannot turn off for just one (generateCustomerToken) as it's in the middleware.
@Darren R Yes, node Modules/@ vue storefront/magento api/lib/index. server.js is vsf version 1.2.0, and /node Modules/@ vue storefront/magento api/server/index.js is version 1.3.1.
Maybe I need to rewrite /node_ Modules/@ vue storefront/magento api/server/index.js, but I dont't know how to do it. Do you have a good solution?
Maybe I need to rewrite /node_ Modules/@ vue storefront/magento api/server/index.js, but I dont't know how to do it. Do you have a good solution?
@Caroline I'm not sure you can overwrite just that one function and overwriting the full file wouldn't be ideal.
We turned off the recaptcha in our env and then used HTTP headers on the queries we wanted protecting: https://developer.adobe.com/commerce/webapi/graphql/usage/protected-mutations/
Protected mutations
Learn how to use CAPTCHA and reCAPTCHA to protect GraphQL mutations.
@Darren R Thanks, I'll try this method;