[WIP] New GoogleReCAPTCHA code

Support for v3
v2-invisible doesn't work yet
This commit is contained in:
slawkens
2020-10-15 19:55:12 +02:00
parent 881a28138a
commit 1a36aa8904
9 changed files with 178 additions and 25 deletions

View File

@@ -45,6 +45,22 @@
<td><input type="checkbox" id="remember_me" name="remember_me" value="true" />
<label for="remember_me"> Remember me</label></td>
</tr>
{% if config.recaptcha_enabled %}
{% if config.recaptcha_type == 'v3' %}
<input type="hidden" name="g-recaptcha-response" id="g-recaptcha-response" />
{% elseif config.recaptcha_type == 'v2-invisible' %}
<div class="g-recaptcha" data-sitekey="{{ config.recaptcha_site_key }}" data-bind="login-submit"></div>
{% elseif config.recaptcha_type == 'v2-checkbox' %}
<tr>
<td class="LabelV" style="width: 150px">
<span{% if error is not null %} class="red"{% endif %}>Verification:</span>
</td>
<td>
<div class="g-recaptcha" data-sitekey="{{ config.recaptcha_site_key }}" data-theme="{{ config.recaptcha_theme }}"></div>
</td>
</tr>
{% endif %}
{% endif %}
</table>
<div style="float: right; font-size: 1px;" >
<input type="hidden" name="page" value="overview" >
@@ -142,3 +158,7 @@
</tr>
</table>
</div>
{% if config.recaptcha_enabled and config.recaptcha_type == 'v3' %}
{% set action = 'login' %}
{{ include('google_recaptcha_v3.html.twig') }}
{% endif %}