authenticate(); $jti = $decoded->jti ?? null; $exp = $decoded->exp ?? 0; $remaining = $exp - time(); if ($jti && $remaining > 0) { $jwtService->revokeToken($jti, $remaining); securityLog("User logged out and token revoked", ['user_id' => $decoded->user_id, 'jti' => $jti]); } jsonSuccess(null, "Logged out successfully"); } catch (Exception $e) { jsonError("Logout failed", 500); }