This commit is contained in:
parent
48994d8bfd
commit
608bf8f33a
|
@ -22,9 +22,6 @@ async def check_auth(req):
|
||||||
- user_roles: list[str] - Список ролей пользователя.
|
- user_roles: list[str] - Список ролей пользователя.
|
||||||
"""
|
"""
|
||||||
token = req.headers.get("Authorization")
|
token = req.headers.get("Authorization")
|
||||||
# Проверяем и очищаем токен от префикса Bearer если он есть
|
|
||||||
if token.startswith('Bearer '):
|
|
||||||
token = token.split('Bearer ')[-1].strip()
|
|
||||||
|
|
||||||
host = req.headers.get('host', '')
|
host = req.headers.get('host', '')
|
||||||
logger.debug(f"check_auth: host={host}")
|
logger.debug(f"check_auth: host={host}")
|
||||||
|
@ -34,8 +31,11 @@ async def check_auth(req):
|
||||||
user_id = ""
|
user_id = ""
|
||||||
user_roles = []
|
user_roles = []
|
||||||
if token:
|
if token:
|
||||||
|
# Проверяем и очищаем токен от префикса Bearer если он есть
|
||||||
|
if token.startswith('Bearer '):
|
||||||
|
token = token.split('Bearer ')[-1].strip()
|
||||||
# Logging the authentication token
|
# Logging the authentication token
|
||||||
logger.debug(f"{token}")
|
logger.debug(f"TOKEN: {token}")
|
||||||
query_name = "validate_jwt_token"
|
query_name = "validate_jwt_token"
|
||||||
operation = "ValidateToken"
|
operation = "ValidateToken"
|
||||||
variables = {"params": {"token_type": "access_token", "token": token}}
|
variables = {"params": {"token_type": "access_token", "token": token}}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user