Skip to content

Show a styled sign-in result page in the browser - #261

Merged
Gorka Gonzalo (d0ubl3g) merged 1 commit into
devfrom
fix/257-branded-callback-page
Oct 31, 2026
Merged

Gorka Gonzalo (d0ubl3g) merged 1 commit into
devfrom
fix/257-branded-callback-page

Conversation

@d0ubl3g

Copy link
Copy Markdown
Contributor

The page the browser shows at the end of hodeishield login was unstyled English text, unlike the consent screen before it.

Change

  • New auth/callback_page.rs renders the success, denied, failed, mismatched-state and not-found pages.
  • The language follows the browser's Accept-Language (q-values honoured): English, Spanish, German, French, Italian or Basque, with English as the fallback.
  • One inline stylesheet that follows the system light or dark preference, an inline SVG mark, one heading, a lang attribute and a "you can close this window" line.
  • No script, no font and no outside request. The Content Security Policy is default-src 'none' with the stylesheet allowed by its hash, plus base-uri 'none', form-action 'none' and frame-ancestors 'none'.
  • Nothing from the request (query parameters, error text) is written into the page.
  • A provider error other than access_denied now answers 400 Bad Request instead of 200 OK.

Tests

  • Unit tests for language negotiation, every page in every language, the policy hash, the statuses and the absence of network references.
  • A loopback test that checks status, policy, lang and headline in two languages, and that nothing from the request is reflected.

cargo fmt --check, cargo clippy --workspace --all-targets -D warnings, cargo xtask codegen --check and cargo test --workspace pass (383 tests).

The page the loopback listener returns at the end of `hodeishield login` was
a bare paragraph. It is now a self-contained page with the product mark, for
success, denied access, a failed or mismatched response and unknown paths. It
follows the system light or dark preference, loads nothing from the network and
runs no script, and a Content-Security-Policy header allows only its
stylesheet by hash. The text is in English, Spanish, German or French,
following Accept-Language, and nothing from the request is written into it.

Closes #257

Signed-off-by: d0ubl3g <48954024+d0ubl3g@users.noreply.github.com>
@d0ubl3g
Gorka Gonzalo (d0ubl3g) merged commit 41d4daa into dev Oct 31, 2026
23 checks passed
@d0ubl3g
Gorka Gonzalo (d0ubl3g) deleted the fix/257-branded-callback-page branch October 31, 2026 19:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant