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

Allow showing auth info on blank page #3002

Merged
merged 2 commits into from
Nov 29, 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
3 changes: 1 addition & 2 deletions locust/web.py
Original file line number Diff line number Diff line change
Expand Up @@ -550,8 +550,7 @@ def login():
self.auth_args["info"] = session.get("auth_info", None)

return render_template_from(
"auth.html",
auth_args=self.auth_args,
"auth.html", auth_args=self.auth_args, auth_title=self.auth_args.get("title", "Locust")
)

@app_blueprint.route("/user", methods=["POST"])
Expand Down
2 changes: 1 addition & 1 deletion locust/webui/auth.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />

<title>Locust</title>
<title>{{ auth_title | default("Locust") }}</title>
</head>
<body>
<div id="root"></div>
Expand Down
3 changes: 3 additions & 0 deletions locust/webui/src/pages/Auth.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@ export default function Auth({
</Box>
</form>
)}
{info && !customForm && !usernamePasswordCallback && (
<Alert severity='info'>{<Markdown content={info} />}</Alert>
)}
{authProviders && (
<Box sx={{ display: 'flex', flexDirection: 'column', rowGap: 1 }}>
{authProviders.map(({ label, callbackUrl, iconUrl }, index) => (
Expand Down