From 254cb707ee42f82f9878bc4f91e62ad8f90f5285 Mon Sep 17 00:00:00 2001 From: Leandro Ribeiro Gomes Date: Thu, 10 Jul 2025 23:33:27 -0300 Subject: [PATCH] Potential fix for code scanning alert no. 1: Flask app is run in debug mode Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> --- auth_server.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/auth_server.py b/auth_server.py index c018574..ad86012 100644 --- a/auth_server.py +++ b/auth_server.py @@ -33,5 +33,8 @@ def protected(): return jsonify({"message": f"Bem-vindo, {TOKENS[token]}!"}) return jsonify({"message": "Não autorizado"}), 401 +import os + if __name__ == "__main__": - app.run(debug=True) + debug_mode = os.getenv("FLASK_ENV", "production") == "development" + app.run(debug=debug_mode)