test connection params

This commit is contained in:
Inex Code 2024-07-04 20:55:00 +04:00
parent a7be03a6d3
commit be1656c37f

View file

@ -17,5 +17,10 @@ class IsAuthenticated(BasePermission):
if token is None: if token is None:
token = info.context["request"].query_params.get("token") token = info.context["request"].query_params.get("token")
if token is None: if token is None:
connection_params = info.context.get("connection_params")
print("Printing connection params from the ws connect!")
print(connection_params)
token = connection_params.get("Authorization")
if token in None:
return False return False
return is_token_valid(token.replace("Bearer ", "")) return is_token_valid(token.replace("Bearer ", ""))