From cfb4689c4d283d350f14b1e1dd7cde80f3a2946c Mon Sep 17 00:00:00 2001 From: Jepp9350 <2jepp9350@gmail.com> Date: Wed, 22 Jan 2025 17:48:15 +0100 Subject: [PATCH] Add cache clearing after token deletion Ensure token consistency by clearing it from the cache after deletion from the database. This prevents potential issues with stale data in the caching layer. --- objects/tokens_o.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/objects/tokens_o.php b/objects/tokens_o.php index 4a1a3956..1bd541d9 100644 --- a/objects/tokens_o.php +++ b/objects/tokens_o.php @@ -80,5 +80,8 @@ class tokens_o extends db // Prepare the SQL statement $sql = "DELETE FROM $this->table WHERE token = '$token'"; $db->query($sql); + + // Clear the token from the cache + redis->clear_token($token); } } \ No newline at end of file