Repository navigation
fix(visualize-only): land on /visualizer/ after one-time sign-in - #18
Merged
Merged
Conversation
The auto-login view always redirected to the dashboard, so `uvx simpleaudit-studio --visualize-only` dropped the user on the unpopulated dashboard instead of the visualizer. - auto_login_view now honors SIMPLEAUDIT_AUTO_LOGIN_NEXT (server-side env var, relative paths only — no open redirect) as the post-login target, falling back to the dashboard - visualize-only mode sets it to /visualizer/, so both the printed one-time sign-in link and the auto-opened browser land on the visualizer - tests for the new redirect + relative-path guard
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
uvx simpleaudit-studio --visualize-only --results_dir ./resultsopens the one-time sign-in link, but after signing in the browser lands on the dashboard (/) instead of the visualizer (/visualizer/). In visualize-only mode the dashboard is unpopulated, so users hit a dead end and have to navigate to/visualizer/manually.Fix
auto_login_view(infra/ui.py) now honors a server-sideSIMPLEAUDIT_AUTO_LOGIN_NEXTenv var as the post-login redirect target, falling back to the dashboard when unset./...) are accepted; absolute (http://) and protocol-relative (//evil) values are ignored._run_visualize_only(simpleaudit_studio/cli.py) setsSIMPLEAUDIT_AUTO_LOGIN_NEXT=/visualizer/, so both the printed one-time sign-in link and the auto-opened browser land on the visualizer.Tests
infra/tests/test_minimal_config.py::TestAutoLoginToken:test_redirects_to_visualizer_when_next_set— 302 to/visualizer/when the env var is settest_next_must_be_a_relative_path— absolute / protocol-relative / empty values are ignoredAll 9 auto-login tests pass (7 pre-existing + 2 new); full file: 18 passed. Ruff clean. (Black reports the 3 files as unformatted, but so does pristine origin/main — pre-existing baseline, not introduced here.)