Added Cloudflare Turnstile as alternative to Google reCAPTCHA

Added the option to select Cloudflare's Turnstile instead of Google's reCAPTCHA for the login page due to it's less intrusive usage and better accessibility options.
This commit is contained in:
KuJoe 2024-05-20 20:19:32 -04:00
commit 46be29978d
7 changed files with 74 additions and 27 deletions

View file

@ -121,7 +121,13 @@ get('/index', function () {
post('/login', function () {
$proper = (is_csrf_proper(from($_REQUEST, 'csrf_token')));
if (config('login.protect.system') === 'google') {
$captcha = isCaptcha(from($_REQUEST, 'g-recaptcha-response'));
} elseif (config('login.protect.system') === 'cloudflare') {
$captcha = isTurnstile(from($_REQUEST, 'cf-turnstile-response'));
} else {
$captcha = true;
}
$user = from($_REQUEST, 'user');
$pass = from($_REQUEST, 'password');