Skip to content

Commit

Permalink
Merge pull request #2915 from andrewbaldwin44/bugfix/auth-submit
Browse files Browse the repository at this point in the history
Web UI Auth submit should submit a POST request
  • Loading branch information
cyberw committed Sep 27, 2024
2 parents 1c1d907 + 17ce31c commit 942534f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
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

0 comments on commit 942534f

Please sign in to comment.