From 8d6cb83506bcaa6b48aa1b24c31678a83b69374b Mon Sep 17 00:00:00 2001 From: ilotterytea Date: Tue, 29 Apr 2025 14:25:32 +0500 Subject: feat: captcha --- src/accounts.php | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src') diff --git a/src/accounts.php b/src/accounts.php index f97998a..35ca0c3 100644 --- a/src/accounts.php +++ b/src/accounts.php @@ -5,6 +5,11 @@ function authorize_user(bool $required = false): bool { session_start(); + if (!isset($_SESSION["captcha_solved"]) && !CLIENT_REQUIRES_JSON) { + header("Location: /captcha.php"); + exit; + } + if (!isset($_COOKIE["secret_key"]) && !isset($_SERVER["HTTP_AUTHORIZATION"])) { if (isset($_SESSION["user_id"])) { session_unset(); -- cgit v1.2.3