cors-connect
This commit is contained in:
parent
c468500109
commit
a395e4e55d
|
@ -51,6 +51,10 @@ server {
|
||||||
# Custom location block for /connect
|
# Custom location block for /connect
|
||||||
location /connect {
|
location /connect {
|
||||||
proxy_pass http://presence-8080;
|
proxy_pass http://presence-8080;
|
||||||
|
{{ $cors_headers_options }}
|
||||||
|
{{ $cors_headers_post }}
|
||||||
|
{{ $cors_headers_get }}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
location ~* \.(jpg|jpeg|png|gif|ico|css|js)$ {
|
location ~* \.(jpg|jpeg|png|gif|ico|css|js)$ {
|
||||||
|
|
|
@ -3,11 +3,12 @@ from httpx import AsyncClient, HTTPError
|
||||||
from settings import AUTH_URL
|
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):
|
async def check_auth(req):
|
||||||
token = req.headers.get("Authorization")
|
token = req.headers.get("Authorization")
|
||||||
|
print(f"[services.auth] checking auth token: {token}")
|
||||||
gql = (
|
gql = (
|
||||||
{"mutation": "{ getSession { user { id } } }"}
|
{"mutation": "{ getSession { user { id } } }"}
|
||||||
if INTERNAL_AUTH_SERVER
|
if INTERNAL_AUTH_SERVER
|
||||||
|
|
Loading…
Reference in New Issue
Block a user