diff --git a/api/blueprints/finstitutions/trading/oauth/callback.py b/api/blueprints/finstitutions/trading/oauth/callback.py index fd53062..bc4055a 100644 --- a/api/blueprints/finstitutions/trading/oauth/callback.py +++ b/api/blueprints/finstitutions/trading/oauth/callback.py @@ -82,7 +82,7 @@ import asyncio # Related to Quart: -trading_oauth_callback_bp = Blueprint("trading_cb", __name__) +trading_oauth_callback_bp = Blueprint("trading_oauth_cb", __name__) # ***************************************************************************************************************** @@ -115,7 +115,12 @@ def init(blueprint_setup_state): async def handle_auth_exception(): - print("Hi! Cleaning up...") + """ + Use this to handle any exceptions that occur in the process of accepting authorization details. Zero's direct + library, for instance, raise several exceptions for cases like expired tokens, checksum failures, etc. + :return: A web-view that indicates failure. + """ + return await render_template( "/finstitutions/trading/oauth/oauth_failure_v2.html", client = g.client_label, @@ -190,19 +195,6 @@ async def trading_oauth_callback( # ┛┗┗ ┛┣┛┗┛┛┗┛┗ # ┛ - # # No valid client: - # if success is None: return ResponseModel( - # status_code = StatusCodes.FAILED, - # http_code = HttpCodes.BAD_REQUEST, - # message = f"Invalid/unimplemented client '{trading_client}'." - # ) - # - # # When the client was valid: - # return ResponseModel( - # status_code = StatusCodes.OK if success else StatusCodes.FAILED, - # http_code = HttpCodes.SUCCESS if success else HttpCodes.INTERNAL_SERVER_ERROR, - # ) - # No valid client: if success is None: return await render_template( "/finstitutions/trading/oauth/oauth_failure_v2.html", diff --git a/kill.sh b/kill.sh index 368f446..35ef109 100644 --- a/kill.sh +++ b/kill.sh @@ -3,7 +3,7 @@ # Kill all the scripts: echo "Killing the script." pkill -9 -f "$(pwd)/api/main.py" -pkill -9 -f "$(pwd)/wsocket/main.py" +pkill -9 -f "$(pwd)/playground/socketio/tick_simulator.py" # Get the name of the current directory, # and kill the monitors of the above scripts: diff --git a/playground/socketio/tick_simulator.py b/playground/socketio/tick_simulator.py index 064df3e..6a4e9a0 100644 --- a/playground/socketio/tick_simulator.py +++ b/playground/socketio/tick_simulator.py @@ -338,7 +338,7 @@ if __name__ == "__main__": # Run the web server runner = web.AppRunner(app) await runner.setup() - site = web.TCPSite(runner, "0.0.0.0", 5000) + site = web.TCPSite(runner, "0.0.0.0", 5214) print("Server running on http://0.0.0.0:5000") await site.start() diff --git a/run.sh b/run.sh index b5caa9c..c47ade0 100644 --- a/run.sh +++ b/run.sh @@ -3,7 +3,7 @@ # Use this to run the microservice without any docker setup. source .venv/bin/activate python3 "$(pwd)/api/main.py" --host "0.0.0.0" --port 5106 --workers 4 --script-id "kps_cnv_KBC3MoaU" & -python3 "$(pwd)/wsocket/main.py" & +python3 "$(pwd)/playground/socketio/tick_simulator.py" & deactivate # All done: