cors-connect

This commit is contained in:
2023-10-11 14:39:08 +03:00
parent c468500109
commit a395e4e55d
2 changed files with 6 additions and 1 deletions

View File

@@ -3,11 +3,12 @@ from httpx import AsyncClient, HTTPError
from settings import AUTH_URL
INTERNAL_AUTH_SERVER = "v2.discours" in AUTH_URL
INTERNAL_AUTH_SERVER = "v2.discours" in AUTH_URL or "testapi.discours" in AUTH_URL
async def check_auth(req):
token = req.headers.get("Authorization")
print(f"[services.auth] checking auth token: {token}")
gql = (
{"mutation": "{ getSession { user { id } } }"}
if INTERNAL_AUTH_SERVER