From 2f58aa563a0d03770d8892bb41f11898ff7e0815 Mon Sep 17 00:00:00 2001 From: overplayed <47672088+overplayed@users.noreply.github.com> Date: Sat, 15 Mar 2025 19:58:07 -0400 Subject: [PATCH] Implemented token expiration tracking and user import --- db.php | 6 +++++- submit.php | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/db.php b/db.php index d92651d..5958255 100644 --- a/db.php +++ b/db.php @@ -1,6 +1,6 @@ connect_error) { die("Database connection failed: " . $conn->connect_error); } + +// Mark expired tokens +$conn->query("UPDATE users SET expired = 1 WHERE expiry_date < NOW() AND expired = 0"); + ?> diff --git a/submit.php b/submit.php index e6def61..723a2aa 100644 --- a/submit.php +++ b/submit.php @@ -43,7 +43,7 @@ if (!$user) { exit; } // Check if token is expired -if (strtotime($user['token_expires_at']) < time()) { +if ($user['expired'] == 1) { http_response_code(403); echo json_encode(["error" => "Authentication token has expired."]); exit;