From a395e4e55df78d4b83e634f919b68e67f5f5dc51 Mon Sep 17 00:00:00 2001 From: Untone Date: Wed, 11 Oct 2023 14:39:08 +0300 Subject: [PATCH] cors-connect --- nginx.conf.sigil | 4 ++++ services/auth.py | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/nginx.conf.sigil b/nginx.conf.sigil index 80ae405..35549b2 100644 --- a/nginx.conf.sigil +++ b/nginx.conf.sigil @@ -51,6 +51,10 @@ server { # Custom location block for /connect location /connect { proxy_pass http://presence-8080; + {{ $cors_headers_options }} + {{ $cors_headers_post }} + {{ $cors_headers_get }} + } location ~* \.(jpg|jpeg|png|gif|ico|css|js)$ { diff --git a/services/auth.py b/services/auth.py index 62a9b76..c3a2301 100644 --- a/services/auth.py +++ b/services/auth.py @@ -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