precommit
This commit is contained in:
@@ -10,6 +10,7 @@ import logging
|
||||
logger = logging.getLogger("\t[services.auth]\t")
|
||||
logger.setLevel(logging.DEBUG)
|
||||
|
||||
|
||||
async def check_auth(req) -> str | None:
|
||||
token = req.headers.get("Authorization")
|
||||
user_id = ""
|
||||
@@ -49,6 +50,7 @@ async def check_auth(req) -> str | None:
|
||||
return user_id
|
||||
except Exception as e:
|
||||
import traceback
|
||||
|
||||
traceback.print_exc()
|
||||
# Handling and logging exceptions during authentication check
|
||||
print(f"[services.auth] Error {e}")
|
||||
|
@@ -9,6 +9,7 @@ headers = {"Content-Type": "application/json"}
|
||||
|
||||
# TODO: rewrite to orm usage?
|
||||
|
||||
|
||||
async def _request_endpoint(query_name, body) -> Any:
|
||||
async with aiohttp.ClientSession() as session:
|
||||
async with session.post(API_BASE, headers=headers, json=body) as response:
|
||||
|
@@ -9,6 +9,7 @@ import logging
|
||||
logger = logging.getLogger("\t[services.redis]\t")
|
||||
logger.setLevel(logging.DEBUG)
|
||||
|
||||
|
||||
class RedisCache:
|
||||
def __init__(self, uri=REDIS_URL):
|
||||
self._uri: str = uri
|
||||
|
Reference in New Issue
Block a user