test: fix shared state leak and fragile expiry assertion in oauth tests
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user