This commit is contained in:
@@ -70,7 +70,7 @@ class EnhancedGraphQLHTTPHandler(GraphQLHTTPHandler):
|
||||
logger.debug(f"[graphql] Добавлены данные авторизации в контекст из scope: {type(auth_cred).__name__}")
|
||||
|
||||
# Проверяем, есть ли токен в auth_cred
|
||||
if auth_cred is not None and hasattr(auth_cred, "token") and getattr(auth_cred, "token"):
|
||||
if auth_cred is not None and hasattr(auth_cred, "token") and auth_cred.token:
|
||||
token_val = auth_cred.token
|
||||
token_len = len(token_val) if hasattr(token_val, "__len__") else 0
|
||||
logger.debug(f"[graphql] Токен найден в auth_cred: {token_len}")
|
||||
@@ -79,7 +79,7 @@ class EnhancedGraphQLHTTPHandler(GraphQLHTTPHandler):
|
||||
|
||||
# Добавляем author_id в контекст для RBAC
|
||||
author_id = None
|
||||
if auth_cred is not None and hasattr(auth_cred, "author_id") and getattr(auth_cred, "author_id"):
|
||||
if auth_cred is not None and hasattr(auth_cred, "author_id") and auth_cred.author_id:
|
||||
author_id = auth_cred.author_id
|
||||
elif isinstance(auth_cred, dict) and "author_id" in auth_cred:
|
||||
author_id = auth_cred["author_id"]
|
||||
|
||||
Reference in New Issue
Block a user