test: fix shared state leak and fragile expiry assertion in oauth tests

This commit is contained in:
2026-05-08 13:30:16 -04:00
parent dbb779b013
commit 82cbce9615
2 changed files with 13 additions and 4 deletions
+1
View File
@@ -43,6 +43,7 @@ def validate_state(state: str) -> bool:
def _purge_states() -> None:
"""Remove all expired CSRF state tokens from the in-memory store."""
now = time.time()
expired = [k for k, exp in list(_states.items()) if exp < now]
for k in expired: