Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extend for plugins/modules #14

Open
jakepm opened this issue Jun 11, 2020 · 3 comments
Open

Extend for plugins/modules #14

jakepm opened this issue Jun 11, 2020 · 3 comments

Comments

@jakepm
Copy link

jakepm commented Jun 11, 2020

I understand that this plugin is designed to be an entirely client-side solution, but would it be possible/easy to extend this plugin so that it can be used in a Craft plugin or module?

In a controller action it would be really handy if we could do a one-liner call to the plugin to validate a token, which could be include in the front-end form ( eg. {% include ['_recaptcha/token'] %} ).

@clarknelson
Copy link
Owner

Google's reCaptcha 3 is actually a two part solution, there is code being run on the front-end and the back-end. I don't think it's possible to validate entirely on the backend to use this in PHP code. So you are looking for a controller action to hit with your plugin? I believe reCaptcha uses browser data such as cookies to determine if the user is a bot or not. Hopefully this helps, would like to know more about your use case.

@jakepm
Copy link
Author

jakepm commented Jul 3, 2020

I was just hoping to handle the back-end component in my own module rather than your plugin, so that the reCAPTCHA check can happen on form post rather than as an Ajax call from the front end.

Not a problem if you can't support this though, the plugin works great as a standalone solution that does the back-end post over Ajax.

@clarknelson
Copy link
Owner

Thanks for the comment, I want to go back and add support for .env variables and maybe an ability to hide the front-end. Just want to make sure I understand what people are asking for so I can try to add that also.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants