mirror of
https://github.com/joaovitoriasilva/endurain.git
synced 2026-01-07 23:13:57 -05:00
Fix timezone handling in OAuth state expiry check
Ensures that the expires_at field is compared as a UTC-aware datetime to prevent errors when checking if an OAuth state has expired.
This commit is contained in:
@@ -33,7 +33,7 @@ def get_oauth_state_by_id(
|
||||
return None
|
||||
|
||||
# Check expiry
|
||||
if datetime.now(timezone.utc) > oauth_state.expires_at:
|
||||
if datetime.now(timezone.utc) > oauth_state.expires_at.replace(tzinfo=timezone.utc):
|
||||
core_logger.print_to_log(f"OAuth state expired: {state_id[:8]}...", "warning")
|
||||
return None
|
||||
|
||||
|
||||
Reference in New Issue
Block a user