summaryrefslogtreecommitdiff
path: root/src/accounts.php
diff options
context:
space:
mode:
Diffstat (limited to 'src/accounts.php')
-rw-r--r--src/accounts.php5
1 files changed, 5 insertions, 0 deletions
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();