This commit is contained in:
@@ -24,7 +24,8 @@ def role_required(required_role: UserRoles):
|
||||
auth_type = current_user_identity['type']
|
||||
|
||||
if auth_type == "node":
|
||||
node = app.active_clients.get("client_id")
|
||||
node = current_app.active_clients.get(user_id)
|
||||
print("Node", node)
|
||||
|
||||
if not node:
|
||||
abort(401, "Node not found or invalid token.")
|
||||
|
||||
@@ -45,7 +45,9 @@ async def request_token_route():
|
||||
# --- Logic for selecting a preferred ID based on client_id (TODO) ---
|
||||
|
||||
selected_id = avail_ids[0]
|
||||
print("Selected Discord ID: ", selected_id)
|
||||
current_app.active_clients[client_id].active_token = selected_id
|
||||
print(current_app.active_clients[client_id])
|
||||
|
||||
# --- End of logic for selecting a preferred ID ---
|
||||
|
||||
|
||||
@@ -26,6 +26,8 @@ async def register_client(websocket, client_id, client_nickname):
|
||||
# Create a JWT for the client
|
||||
current_app.active_clients[client_id].access_token = create_access_token(identity={"id": client_id, "username": client_nickname, "type": "node"})
|
||||
|
||||
print(current_app.active_clients[client_id])
|
||||
|
||||
# Start a task to listen for messages from this client
|
||||
asyncio.create_task(listen_to_client(websocket, client_id))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user