deactivate captcha for onion
This commit is contained in:
@@ -88,8 +88,9 @@ export default (router, tpl) => {
|
|||||||
return renderError("Passwords do not match.");
|
return renderError("Passwords do not match.");
|
||||||
}
|
}
|
||||||
|
|
||||||
// reCAPTCHA verification
|
// reCAPTCHA verification (bypassed for .onion requests as Google reCAPTCHA cannot validate .onion domains)
|
||||||
if (cfg.recaptcha?.enabled && cfg.recaptcha?.secret_key) {
|
const isOnion = req.headers['host']?.endsWith('.onion');
|
||||||
|
if (!isOnion && cfg.recaptcha?.enabled && cfg.recaptcha?.secret_key) {
|
||||||
const rcToken = req.post['g-recaptcha-response'];
|
const rcToken = req.post['g-recaptcha-response'];
|
||||||
if (!rcToken) return renderError("Please complete the reCAPTCHA.");
|
if (!rcToken) return renderError("Please complete the reCAPTCHA.");
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -1496,6 +1496,9 @@ process.on('uncaughtException', err => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (req) {
|
if (req) {
|
||||||
|
if (req.headers['host']?.endsWith('.onion')) {
|
||||||
|
data.recaptcha_enabled = false;
|
||||||
|
}
|
||||||
if (req.mode !== undefined) data.mode = req.mode;
|
if (req.mode !== undefined) data.mode = req.mode;
|
||||||
data.theme = req.theme || req.cookies?.theme || cfg.websrv.theme || 'f0ck';
|
data.theme = req.theme || req.cookies?.theme || cfg.websrv.theme || 'f0ck';
|
||||||
if (!data.url) data.url = req.url;
|
if (!data.url) data.url = req.url;
|
||||||
|
|||||||
Reference in New Issue
Block a user