feat: add sliding session timeout with idle and absolute caps
This commit is contained in:
@@ -10,10 +10,10 @@ class SessionService:
|
||||
@staticmethod
|
||||
def get_active_session_by_token(token):
|
||||
"""Get active session by token.
|
||||
|
||||
|
||||
Args:
|
||||
token: The session token string
|
||||
|
||||
|
||||
Returns:
|
||||
Session object if found and active, None otherwise
|
||||
"""
|
||||
@@ -23,6 +23,8 @@ class SessionService:
|
||||
token=token,
|
||||
status=SessionStatus.ACTIVE,
|
||||
deleted_at=None
|
||||
).filter(
|
||||
Session.expires_at > datetime.now(timezone.utc)
|
||||
).first()
|
||||
|
||||
@staticmethod
|
||||
|
||||
Reference in New Issue
Block a user