check-deploy
Some checks failed
deploy / deploy (push) Failing after 1m27s

This commit is contained in:
2024-02-03 18:36:33 +03:00
parent 59a1f8c902
commit 15fd6ec765
5 changed files with 41 additions and 10 deletions

View File

@@ -37,15 +37,24 @@ async def check_auth(req) -> str | None:
try:
# Asynchronous HTTP request to the authentication server
async with ClientSession() as session:
async with session.post(AUTH_URL, json=gql, headers=headers) as response:
print(f'[services.auth] HTTP Response {response.status} {await response.text()}')
async with session.post(
AUTH_URL, json=gql, headers=headers
) as response:
print(
f'[services.auth] HTTP Response {response.status} {await response.text()}'
)
if response.status == 200:
data = await response.json()
errors = data.get('errors')
if errors:
print(f'[services.auth] errors: {errors}')
print(f'errors: {errors}')
else:
user_id = data.get('data', {}).get(query_name, {}).get('claims', {}).get('sub')
user_id = (
data.get('data', {})
.get(query_name, {})
.get('claims', {})
.get('sub')
)
if user_id:
print(f'[services.auth] got user_id: {user_id}')
return user_id