Update AuthManager.php

Signed-off-by: Zoey <zoey@z0ey.de>
This commit is contained in:
Zoey
2026-08-19 21:34:18 +02:00
parent 2c978e9556
commit bf297e25f6
+1 -6
View File
@@ -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;
}