diff --git a/app/config/jwt_config.py b/app/config/jwt_config.py index f758c28..aaccdc4 100644 --- a/app/config/jwt_config.py +++ b/app/config/jwt_config.py @@ -9,6 +9,7 @@ def configure_jwt(app): """Configures JWT settings for the Quart app.""" app.config["JWT_SECRET_KEY"] = os.getenv("JWT_SECRET_KEY", "your-super-secret-key-that-should-be-in-env") app.config["JWT_ACCESS_TOKEN_EXPIRES"] = 3600 # 1 hour + app.config["JWT_ALGORITHM"] = "HS256" # You might need to set a custom error handler for unauthorized access # @app.errorhandler(401) # def unauthorized(error): diff --git a/app/server.py b/app/server.py index 4f88025..6a73b6f 100644 --- a/app/server.py +++ b/app/server.py @@ -4,6 +4,7 @@ import websockets import json import uuid from quart import Quart, jsonify, request +from quart_cors import cors from routers.systems import systems_bp from routers.nodes import nodes_bp, register_client, unregister_client from routers.bot import bot_bp @@ -53,6 +54,7 @@ async def websocket_server_handler(websocket): # --- Quart API Components --- app = Quart(__name__) +app = cors(app, allow_origin="*") # Store the websocket server instance websocket_server_instance = None diff --git a/requirements.txt b/requirements.txt index 52bcfea..ebe3322 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,6 @@ websockets quart +quart-cors motor fastapi quart-jwt-extended