This commit is contained in:
@@ -7,7 +7,7 @@ from services.db import local_session
|
||||
from settings import AUTH_URL
|
||||
|
||||
|
||||
async def check_auth(req) -> (bool, int | None):
|
||||
async def check_auth(req):
|
||||
token = req.headers.get("Authorization")
|
||||
if token:
|
||||
# Logging the authentication token
|
||||
@@ -62,7 +62,7 @@ async def check_auth(req) -> (bool, int | None):
|
||||
except Exception as e:
|
||||
# Handling and logging exceptions during authentication check
|
||||
print(f"[services.auth] {e}")
|
||||
raise HTTPUnauthorized(message="Please, login first")
|
||||
raise HTTPUnauthorized(text="Please, login first")
|
||||
|
||||
return False, None
|
||||
|
||||
|
@@ -1,5 +1,7 @@
|
||||
from typing import List, Any
|
||||
from typing import Any, List
|
||||
|
||||
import aiohttp
|
||||
|
||||
from settings import API_BASE
|
||||
|
||||
headers = {"Content-Type": "application/json"}
|
||||
@@ -23,7 +25,7 @@ async def _request_endpoint(query_name, body):
|
||||
traceback.print_exc()
|
||||
|
||||
|
||||
async def get_followed_shouts(author_id: int) -> List[Any]:
|
||||
async def get_followed_shouts(author_id: int):
|
||||
query_name = "load_shouts_followed"
|
||||
query_type = "query"
|
||||
operation = "GetFollowedShouts"
|
||||
|
@@ -2,6 +2,7 @@ import asyncio
|
||||
import json
|
||||
|
||||
import redis.asyncio as aredis
|
||||
|
||||
from settings import REDIS_URL
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user