dep-fix-2
All checks were successful
deploy / deploy (push) Successful in 1m33s

This commit is contained in:
Untone 2023-12-13 23:54:38 +03:00
parent 2fb48d76b6
commit 2518e0357b

View File

@ -38,15 +38,19 @@ async def check_auth(req) -> (bool, int | None):
if response.status == 200:
# Parsing JSON response
data = await response.json()
user_id = data.get("data", {}).get(query_name, {}).get("claims", {}).get("sub")
if user_id:
# Logging the retrieved user ID
print(f"User ID retrieved: {user_id}")
return True, user_id
errors = data.get("errors")
if errors:
print(f"Auth connector errors: {errors}")
else:
# Logging when no user ID is found in the response
print("No user ID found in the response")
user_id = data.get("data", {}).get(query_name, {}).get("claims", {}).get("sub")
if user_id:
# Logging the retrieved user ID
print(f"User ID retrieved: {user_id}")
return True, user_id
else:
# Logging when no user ID is found in the response
print("No user ID found in the response")
else:
# Logging when the request to the authentication server fails
print(f"Request failed with status: {response.status}")