Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Web UI Auth submit should submit a POST request #2915

Merged
merged 1 commit into from
Sep 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions examples/web_ui_auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion locust/webui/src/pages/Auth.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export default function Auth({ authProviders, error, usernamePasswordCallback }:
<Logo />
</Box>
{usernamePasswordCallback && (
<form action={usernamePasswordCallback}>
<form action={usernamePasswordCallback} method='POST'>
<Box sx={{ display: 'flex', flexDirection: 'column', rowGap: 2 }}>
<TextField label='Username' name='username' />
<TextField label='Password' name='password' type='password' />
Expand Down