This commit is contained in:
parent
e539e0334f
commit
4ffcbf36d3
|
@ -22,6 +22,10 @@ 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}")
|
||||||
auth_url = AUTH_URL
|
auth_url = AUTH_URL
|
||||||
|
|
Loading…
Reference in New Issue
Block a user