fixed all test issues
This commit is contained in:
@@ -422,7 +422,11 @@ class UserSession(Base, TimestampMixin):
|
||||
@property
|
||||
def is_expired(self) -> bool:
|
||||
"""Check if session has expired."""
|
||||
return datetime.now(timezone.utc) > self.expires_at
|
||||
# Ensure expires_at is timezone-aware for comparison
|
||||
expires_at = self.expires_at
|
||||
if expires_at.tzinfo is None:
|
||||
expires_at = expires_at.replace(tzinfo=timezone.utc)
|
||||
return datetime.now(timezone.utc) > expires_at
|
||||
|
||||
def revoke(self) -> None:
|
||||
"""Revoke this session."""
|
||||
|
||||
Reference in New Issue
Block a user