-
Notifications
You must be signed in to change notification settings - Fork 196
BUG: Staticman reCAPTCHA Error #7
Comments
Hi, this is the maintainer of @staticmanlab. You may see my Staticman + Beautiful Jekyll + Framagit demo (source) for a working example of reCAPTCHA v2 with Staticman v3 URL scheme. It's built yesterday in response to a similar issue einsteinpy/blog.einsteinpy.org#356. |
After implementing #31, I've tested the reCAPTCHA integration of your theme, and reCAPTCHA isn't showing. The true cause of this error is the lack of a <html>
<head>
<title>reCAPTCHA demo: Simple page</title>
<script src="https://www.google.com/recaptcha/api.js" async defer></script>
</head>
<body>
<form action="?" method="POST">
<div class="g-recaptcha" data-sitekey="your_site_key"></div>
<br/>
<input type="submit" value="Submit">
</form>
</body>
</html> You may compare your code hugo-future-imperfect-slim/layouts/post/staticman.html Lines 1 to 28 in e0eb982
with that of Beautiful Hugo. <form class="js-form form" method="post" action="{{ .Site.Params.staticman.api }}">
<input type="hidden" name="options[slug]" value="{{ replace .RelPermalink "/" "" }}">
<input type="hidden" name="options[parent]" value="">
{{ if .Site.Params.staticman.recaptcha }}
<input type="hidden" name="options[reCaptcha][siteKey]" value="{{ .Site.Params.staticman.recaptcha.sitekey }}">
<input type="hidden" name="options[reCaptcha][secret]" value="{{ .Site.Params.staticman.recaptcha.secret }}">
{{ end }}
<fieldset>
<div class="textfield">
<textarea name="fields[comment]" type="text" placeholder="{{ i18n "useMarkdown" }}"></textarea>
</div>
</fieldset>
<!-- skipped fieldsets -->
{{ if .Site.Params.staticman.recaptcha }}
<fieldset>
<div class="g-recaptcha" data-sitekey="{{ .Site.Params.staticman.recaptcha.sitekey }}"></div>
</fieldset>
{{ end }}
<fieldset>
<button class="button">
Submit
</button>
</fieldset>
</form>
</section> |
Pleaes forget my previous comment. It seems the cause is "The resource from “https://www.google.com/recaptcha/api.js?render=6Lcv8G8UAAAAAEqV1Y-XEPum00C_DxhD6O--qkFo” was blocked due to MIME type (“text/html”) mismatch (X-Content-Type-Options: nosniff)." from my Firefox browser. Updated: Oh! I thought it was reCAPTCHA v2. In fact you're using v3. Need to explore this later. So forget my previous comment. |
Related issue: eduardoboucas/staticman#223 |
Update: Looking at Staticman's PRs, I've found an attempt to support reCAPTCHA v3 with Staticman. Unluckily, it's mixed with lots of changes and it was closed. I've made eduardoboucas/staticman#413 for that. |
Bug Report
Describe the bug
Staticman V2 was not working due to an issue with request limits. Was upgraded to v3 and now it has a reCAPTCHA error even when disabled.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Comment should successfully post
##Screenshots
If applicable, add screenshots to help explain your problem.
Environment
Additional context
See eduardoboucas/staticman#243
The text was updated successfully, but these errors were encountered: