From 17ce31c4cfbabc729fede89e1855a2aaa40e39d3 Mon Sep 17 00:00:00 2001 From: Andrew Baldwin Date: Fri, 27 Sep 2024 10:48:50 +0200 Subject: [PATCH] Auth submit should be a POST request --- examples/web_ui_auth.py | 6 +++--- locust/webui/src/pages/Auth.tsx | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/web_ui_auth.py b/examples/web_ui_auth.py index d97bf3d96c..c846c19215 100644 --- a/examples/web_ui_auth.py +++ b/examples/web_ui_auth.py @@ -64,10 +64,10 @@ def google_login(): return redirect(url_for("index")) - @auth_blueprint.route("/login_submit") + @auth_blueprint.route("/login_submit", methods=["POST"]) def login_submit(): - username = request.args.get("username") - password = request.args.get("password") + username = request.form.get("username") + password = request.form.get("password") # Implement real password verification here if password: diff --git a/locust/webui/src/pages/Auth.tsx b/locust/webui/src/pages/Auth.tsx index eabed20660..d03ce40d10 100644 --- a/locust/webui/src/pages/Auth.tsx +++ b/locust/webui/src/pages/Auth.tsx @@ -37,7 +37,7 @@ export default function Auth({ authProviders, error, usernamePasswordCallback }: {usernamePasswordCallback && ( -
+