CQ fixes
This commit is contained in:
@@ -25,7 +25,7 @@ class InMemoryTokenRepository(TokenRepositoryInterface):
|
|||||||
|
|
||||||
def verify(self, token: str) -> int | None:
|
def verify(self, token: str) -> int | None:
|
||||||
"""Verify token and return user_id if valid, None otherwise.
|
"""Verify token and return user_id if valid, None otherwise.
|
||||||
|
|
||||||
Implements sliding expiration: extends token lifetime on each verification.
|
Implements sliding expiration: extends token lifetime on each verification.
|
||||||
"""
|
"""
|
||||||
if token not in self._tokens:
|
if token not in self._tokens:
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ class RedisTokenRepository(TokenRepositoryInterface):
|
|||||||
|
|
||||||
def verify(self, token: str) -> int | None:
|
def verify(self, token: str) -> int | None:
|
||||||
"""Verify token and return user_id if valid, None otherwise.
|
"""Verify token and return user_id if valid, None otherwise.
|
||||||
|
|
||||||
Implements sliding expiration: extends token lifetime on verification.
|
Implements sliding expiration: extends token lifetime on verification.
|
||||||
"""
|
"""
|
||||||
key = f"token:{token}"
|
key = f"token:{token}"
|
||||||
|
|||||||
Reference in New Issue
Block a user