mCaptcha / glue

glue code to setup mCaptcha on your website
7 stars 7 forks source link

[ISSUE] Be more ISO with other captcha providers #75

Open maxlerebourg opened 4 months ago

maxlerebourg commented 4 months ago

I'm the maintainer of Crowdsec-bouncer-traefik-plugin and some folks ask me to implement mCaptcha provider here.

The front end page to protect user with our plugin, is build like this for every Captcha Provider:

<head>
...
   <script src="{{ .FrontendJS }}" async defer></script>
...
</head>
<body>
...
   <div id="captcha" class="{{ .FrontendKey }}" data-sitekey="{{ .SiteKey }}" data-callback="captchaCallback">
...

  <script>
    function captchaCallback() {
      setTimeout(() => document.querySelector('#captcha-form').submit(), 500);
    }
  </script>
</body>

Is it possible to support this kind of setup with mCaptcha ? It would be super efficient if someone want to change from other provider to mCaptcha.

PS: Excellent project, good initiative to build some complete open source Captcha lib !

realaravinth commented 4 months ago

Thank you for your interest and kind words about mCaptcha :)

Regarding the API, I'll see what I can do. I can't promise an ETA, since I'm kind of busy with work right now, but I'll try to get to it next week.

Could you provide your glue vanilla JS lib from CDN too or put in the README this non official link ?

I'd love to provide an official CDN for mCaptcha, but I don't have the resources for it at the moment. Recommending other CDNs has privacy implications, which I can't do in good conscience :sweat_smile:

maxlerebourg commented 1 week ago

I just open an PR to Glue to try to fix this. I think this will have a breaking change for vanilla package, I let you review it and modify it if you want.

Documentations to inspire you: