From bf297e25f6b198ac6ebc2f98295bf1e28e6d0dce Mon Sep 17 00:00:00 2001 From: Zoey Date: Wed, 19 Aug 2026 21:31:25 +0200 Subject: [PATCH] Update AuthManager.php Signed-off-by: Zoey --- php/src/Auth/AuthManager.php | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/php/src/Auth/AuthManager.php b/php/src/Auth/AuthManager.php index 0fac8b15..109b53c1 100644 --- a/php/src/Auth/AuthManager.php +++ b/php/src/Auth/AuthManager.php @@ -44,12 +44,7 @@ readonly class AuthManager { } // Prevent token replay: reject tokens that have already been used - $tokenHash = hash('sha256', $token); - $cacheKey = 'used_token_' . $tokenHash; - if (apcu_fetch($cacheKey) !== false) { - return false; - } - apcu_add($cacheKey, true, 60); + if (!apcu_add('used_token_' . hash('sha256', $token), true, 60)) return false; return true; }