Skip to content

Theme the Console's other sign-in and set-password replies #1167

Closed

Description

@JacobStephens2

Finding

Several other Console account replies are still bare HTML fragments or plain text. They have no stylesheet and no data-theme, so the browser shows them in its default colours. The /set-password/code page had the same problem before #1166 fixed it:

  • POST /set-password with a wrong or expired code: a 401 with the bare Password not set. Check your code or <a href="/set-password">request another</a>. (src/console/auth/password.rs:139).
  • POST /set-password without a Resend key: a 503 with the plain-text OWNER notice (password.rs:140). Its text also repeats src/console/password_off.html.
  • POST /sign-in refused, and in slowdown: bare fragments, Sign-in failed. <a href="/sign-in">Try again</a>. (src/console/auth.rs:265,271).

ADR 0018 says the Console has one layout with Themes, so these replies don't match the rest of it.

Evidence

This test, added to tests/console/password_codes.rs, fails on the #1166 branch. The response body is the bare Password not set… fragment:

#[test]
fn a_wrong_code_reply_uses_the_console_theme() {
    let home = configured();
    let resend = ResendStandIn::replying(200, "{}");
    let console = start(home.path(), &resend, true);
    let response = post(&console, "/set-password",
        &[("email", EMAIL), ("code", "000000"), ("password", PASSWORD)]);
    assert_eq!(response.status(), 401);
    let html = response.text().unwrap();
    assert!(html.contains("data-theme=\"focus-auto\""), "{html}");
}

Run it with cargo test --test console a_wrong_code_reply_uses_the_console_theme.

Raised by

The Standards review (finding #6) and the Spec review of #1166, which fixed #1054.

Why this wasn't decided there

#1054 asks only for the /set-password/code page to follow the system's light or dark mode. Theming the other routes' replies is a scope decision for the Day shift. It also raises design choices #1054 doesn't settle. One is whether failures should render a page or redirect back to the form with a message. Another is whether the sign-in replies should change together with the set-password ones.

Activity

  1. added
    needs-triage
    on Oct 23, 2026
  2. JacobStephens2 commented on Oct 25, 2026

    @JacobStephens2
    OwnerAuthor

    This was generated by AI during triage.

    Agent Brief

    Category: bug
    Summary: The Console's remaining sign-in and set-password error replies render as themed pages

    Current behavior:
    Some auth replies are still bare: a wrong code on POST /set-password (401 HTML fragment), the password-off notice (503 plain text), and sign-in refused (401) and slowdown (429) on POST /sign-in.

    Desired behavior:
    Each of these replies renders as a full page with the Console theme, using the same template chrome as the set-password code page from #1166. Status codes, the Retry-After header, message text and links are kept. The 503 reuses the existing password-off page.

    Key interfaces:

    • The Console auth handlers for /sign-in and /set-password
    • The shared page template used by the set-password code page

    Acceptance criteria:

    • The issue's a_wrong_code_reply_uses_the_console_theme test passes
    • Matching tests for sign-in refused (401), slowdown (429, with Retry-After) and password off (503), each asserting the themed page (data-theme)
    • Status codes are unchanged

    Out of scope:

    • Redirecting back to the form instead of rendering
    • Changing sign-in rate limits or auth policy
  3. added
    bug
    ready-for-agent
    in-progress
    and removed
    needs-triage
    ready-for-agent
    on Oct 25, 2026
  4. removed
    in-progress
    on Oct 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions