upgrades
All checks were successful
deploy / deploy (push) Successful in 1m10s

This commit is contained in:
2023-12-18 01:20:13 +03:00
parent 693d8b6aee
commit 7fa6fcf2d7
7 changed files with 72 additions and 44 deletions

View File

@@ -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

View File

@@ -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"

View File

@@ -2,6 +2,7 @@ import asyncio
import json
import redis.asyncio as aredis
from settings import REDIS_URL