config.php: rework captcha configuration

This commit is contained in:
Zankaria
2024-08-15 16:11:28 +02:00
parent a275d04efa
commit fb92e5fb68
6 changed files with 72 additions and 69 deletions

View File

@@ -223,15 +223,15 @@ function getCookie(cookie_name) {
}
{% endraw %}
{% if config.dynamic_captcha %}
{% if config.captcha.dynamic %}
function is_dynamic_captcha_enabled() {
let cookie = get_cookie('require-captcha');
return cookie === '1';
}
function get_captcha_pub_key() {
{% if config.recaptcha %}
return "{{ config.recaptcha_public }}";
{% if config.captcha.provider === 'recaptcha' %}
return "{{ config.captcha.recaptcha.sitekey }}";
{% else %}
return null;
{% endif %}