Redirect root to dashboard - #453
Open
JacobHayes wants to merge 1 commit into
Open
Conversation
JacobHayes
force-pushed
the
jrh/root-dashboard-redirect
branch
2 times, most recently
from
July 7, 2026 15:16
3b6897a to
8bba8b7
Compare
JacobHayes
marked this pull request as ready for review
July 7, 2026 23:50
Author
|
Not sure you prefer PRs or if you're adopting prompts-in-issues approach. :) |
JacobHayes
force-pushed
the
jrh/root-dashboard-redirect
branch
2 times, most recently
from
July 9, 2026 02:15
a686728 to
a683fa9
Compare
Add an auth-middleware redirect (307) so hitting the bare root lands on the dashboard without needing proxy rules. Scoped to exact / for safe browser methods; all other paths flow through the existing auth chain. Signed-off-by: Jacob Hayes <jrh@jacobhayes.dev>
JacobHayes
force-pushed
the
jrh/root-dashboard-redirect
branch
from
July 9, 2026 02:26
a683fa9 to
006bc8b
Compare
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.
Summary
GET/HEAD /redirect to/dashboardin the TemperPaw auth middleware./dashboardand leave platform/API surfaces untouched./api,/observe,/paw,/tdata,/auth,/triggers,/healthz, and/readyzrepresentative paths still pass through the middleware.Notes
redir / /dashboard.Proof
.proofs/2026-07-07-root-dashboard-redirect.mdTests
cargo test -p temperpaw auth::tests::unauthenticated_root_redirects_to_dashboard_without_proxy_help -- --nocapturefailed with/returning401instead of307.cargo test -p temperpaw auth::tests:: -- --nocapturecargo fmt --checkcargo test -p temperpawGreptile Summary
This PR adds an unconditional
GET/HEAD /→/dashboardredirect directly inside the TemperPaw auth middleware, removing the need for proxy-level (e.g. Caddy) root redirects.is_dashboard_root_redirect_pathmatches onlyGETandHEADrequests to/exactly, and the corresponding early-return at the top ofmiddlewareemits a307 Temporary Redirectbefore any auth logic runs.Locationheader check) and the helper's negative cases (POST /,/healthz,/api/probe).Confidence Score: 5/5
Safe to merge — the redirect logic is minimal, isolated to the top of the middleware, and does not touch any auth checks for other paths.
The change is a four-line early return that fires only on GET/HEAD to exactly '/'. All other paths, methods, and auth flows are completely unaffected. The helper is pure and trivially correct; the integration test validates the 307 + Location header end-to-end; and the negative-case unit test confirms that no other paths are accidentally intercepted.
No files require special attention.
Important Files Changed
Sequence Diagram
%%{init: {'theme': 'neutral'}}%% sequenceDiagram participant Client participant Middleware as Auth Middleware participant Dashboard as /dashboard participant LoginPage as /dashboard/login Note over Client,LoginPage: Unauthenticated user visits / Client->>Middleware: GET / Middleware-->>Client: 307 Temporary Redirect → /dashboard Client->>Middleware: GET /dashboard Middleware->>Middleware: check auth (no cookie/token) Middleware-->>Client: 307 Temporary Redirect → /dashboard/login Client->>Middleware: GET /dashboard/login Middleware->>Middleware: is_dashboard_public_path → true Middleware->>LoginPage: pass through LoginPage-->>Client: 200 OK (login form) Note over Client,LoginPage: Authenticated user visits / Client->>Middleware: GET / Middleware-->>Client: 307 Temporary Redirect → /dashboard Client->>Middleware: GET /dashboard Middleware->>Middleware: claims_from_headers → valid cookie Middleware->>Dashboard: pass through (with injected auth headers) Dashboard-->>Client: 200 OK%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%% sequenceDiagram participant Client participant Middleware as Auth Middleware participant Dashboard as /dashboard participant LoginPage as /dashboard/login Note over Client,LoginPage: Unauthenticated user visits / Client->>Middleware: GET / Middleware-->>Client: 307 Temporary Redirect → /dashboard Client->>Middleware: GET /dashboard Middleware->>Middleware: check auth (no cookie/token) Middleware-->>Client: 307 Temporary Redirect → /dashboard/login Client->>Middleware: GET /dashboard/login Middleware->>Middleware: is_dashboard_public_path → true Middleware->>LoginPage: pass through LoginPage-->>Client: 200 OK (login form) Note over Client,LoginPage: Authenticated user visits / Client->>Middleware: GET / Middleware-->>Client: 307 Temporary Redirect → /dashboard Client->>Middleware: GET /dashboard Middleware->>Middleware: claims_from_headers → valid cookie Middleware->>Dashboard: pass through (with injected auth headers) Dashboard-->>Client: 200 OKReviews (4): Last reviewed commit: "temperpaw: redirect GET/HEAD / to /dashb..." | Re-trigger Greptile