inbox
This commit is contained in:
parent
ddda4c025f
commit
89827e3cc2
|
@ -10,7 +10,7 @@ INTERNAL_AUTH_SERVER = "v2.discours" in AUTH_URL or "testapi.discours" in AUTH_U
|
||||||
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}")
|
print(f"[services.auth] checking auth token: {token}")
|
||||||
|
|
||||||
query_name = "getSession" if INTERNAL_AUTH_SERVER else "session"
|
query_name = "getSession" if INTERNAL_AUTH_SERVER else "session"
|
||||||
query_type = "mutation" if INTERNAL_AUTH_SERVER else "query"
|
query_type = "mutation" if INTERNAL_AUTH_SERVER else "query"
|
||||||
operation = "GetUserId"
|
operation = "GetUserId"
|
||||||
|
@ -23,7 +23,7 @@ async def check_auth(req):
|
||||||
gql = {
|
gql = {
|
||||||
"query": query_type + " " + operation + " { " + query_name + " { user { id } } " + " }",
|
"query": query_type + " " + operation + " { " + query_name + " { user { id } } " + " }",
|
||||||
"operationName": operation,
|
"operationName": operation,
|
||||||
"variables": "{}"
|
"variables": None
|
||||||
}
|
}
|
||||||
|
|
||||||
async with AsyncClient() as client:
|
async with AsyncClient() as client:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user