Fix a bug with i2p captcha
- if captcha_tor_only is set to true, posting over i2p requires a captcha but the javascript code removes it. Add a check to see if we're on a .i2p domain in this case.
This commit is contained in:
parent
dadb7b2318
commit
cbdb07f53c
|
@ -116,9 +116,9 @@
|
|||
{% if config.captcha_tor_only %}
|
||||
<script>
|
||||
(() => {
|
||||
function isOnionDomain() {
|
||||
function isHiddenService() {
|
||||
const hostname = window.location.hostname;
|
||||
return hostname.endsWith('.onion');
|
||||
return hostname.endsWith('.onion') || hostname.endsWith('.i2p');
|
||||
}
|
||||
|
||||
function removeCaptchaField() {
|
||||
|
@ -126,12 +126,11 @@
|
|||
.forEach(e => e.parentNode.removeChild(e));
|
||||
}
|
||||
|
||||
if (!isOnionDomain()) {
|
||||
if (!isHiddenService()) {
|
||||
removeCaptchaField();
|
||||
}
|
||||
})();
|
||||
</script>
|
||||
{% else %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% if config.user_flag %}
|
||||
|
|
Loading…
Reference in New Issue