summaryrefslogtreecommitdiff
path: root/src/accounts.php
diff options
context:
space:
mode:
authorilotterytea <iltsu@alright.party>2025-04-29 14:25:32 +0500
committerilotterytea <iltsu@alright.party>2025-04-29 14:25:32 +0500
commit8d6cb83506bcaa6b48aa1b24c31678a83b69374b (patch)
treed26e89dfa8aca7723c6992de5b2b0510e45f05a1 /src/accounts.php
parent93c02436fb0b7afffb6c62547385757b1a1b57f8 (diff)
feat: captcha
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();