Connected devices: Sign in again failure and mockup drift (#895 follow-up, v0.6.340) #899

Merged
Cordy merged 9 commits from fix-895b into main 2026-10-14 11:09:02 +00:00
Owner

Follow-up to #895 from Nikola's live check of v0.6.339 and a drift audit against the approved mockup.

Spec: docs/superpowers/specs/2026-10-14-fix-895b-design.md
Plan: docs/superpowers/plans/2026-10-14-fix-895b.md

Sign in again (OIDC)

  • Root cause of "login failed": Keycloak 25+ sends auth_time only with the basic client scope; the Cairn client lacked it (realm file fixed in homelab-config, live realm in the console).
  • Every failed callback logs one WARN oidc callback failed with a reason attribute (IdP error and token-endpoint body cut to 64 bytes).
  • A failed or cancelled Sign in again returns to the connect or approval dialog with a short message instead of the 401 page.
  • next refuses backslashes and control characters (open-redirect guard).

Mockup alignment (A1-A11, B1-B5, C1-C4, D1-D2, E1, F1-F3, G1)

  • Account › Connected devices: separate cards, primary nowrap button, bold count with real months, sentence-case headers, three-tier sort (used, never used, unused last), chips, amber unused row, ISO dates, address footer, #account/<section> deep links that replace history when corrected.
  • Connect dialog: about 640 px, sentence-case labels, expiry select (Never / 1 / 3 / 6 / 12 months / Pick a date…, capped by the admin maximum, month-end clamp, ISO hint), focus vs selected, first Continue click works, Cancel drops a late answer.
  • Ready step: amber "Shown once", paper box with bold UI terms, "Show setup for another app" for the same password.
  • Approval: address stays #connect?code= while open; result dialog closes on navigation.
  • Bell icons per kind; change-password info box; stray "Connected …" text removed.
  • Users & access › Access: one settings box with the readiness block as an amber nested box (readable in dark themes).

Tests: 136 web test files, go test ./... (57 packages), gofmt/vet clean. Reviews: per task plus a whole-branch review, all findings fixed. Live-checked on a local instance (light and dark).

Follow-up to #895 from Nikola's live check of v0.6.339 and a drift audit against the approved mockup. Spec: docs/superpowers/specs/2026-10-14-fix-895b-design.md Plan: docs/superpowers/plans/2026-10-14-fix-895b.md **Sign in again (OIDC)** - Root cause of "login failed": Keycloak 25+ sends `auth_time` only with the `basic` client scope; the Cairn client lacked it (realm file fixed in homelab-config, live realm in the console). - Every failed callback logs one WARN `oidc callback failed` with a `reason` attribute (IdP error and token-endpoint body cut to 64 bytes). - A failed or cancelled Sign in again returns to the connect or approval dialog with a short message instead of the 401 page. - `next` refuses backslashes and control characters (open-redirect guard). **Mockup alignment (A1-A11, B1-B5, C1-C4, D1-D2, E1, F1-F3, G1)** - Account › Connected devices: separate cards, primary nowrap button, bold count with real months, sentence-case headers, three-tier sort (used, never used, unused last), chips, amber unused row, ISO dates, address footer, `#account/<section>` deep links that replace history when corrected. - Connect dialog: about 640 px, sentence-case labels, expiry select (Never / 1 / 3 / 6 / 12 months / Pick a date…, capped by the admin maximum, month-end clamp, ISO hint), focus vs selected, first Continue click works, Cancel drops a late answer. - Ready step: amber "Shown once", paper box with bold UI terms, "Show setup for another app" for the same password. - Approval: address stays `#connect?code=` while open; result dialog closes on navigation. - Bell icons per kind; change-password info box; stray "Connected …" text removed. - Users & access › Access: one settings box with the readiness block as an amber nested box (readable in dark themes). Tests: 136 web test files, `go test ./...` (57 packages), gofmt/vet clean. Reviews: per task plus a whole-branch review, all findings fixed. Live-checked on a local instance (light and dark).
A reauth whose ID token has no or a stale auth_time (Keycloak 25+ without
the basic client scope) now returns *auth.ReauthError (ErrReauthNotConfirmed)
carrying the flow's next. The callback logs one WARN 'oidc callback failed:
<reason>' for every failure and redirects a reauth failure to
safeNext(next) + reauth=failed (no session, no ConfirmedAt). The connect and
approval dialogs show why, in four languages. Docs: basic client scope;
CHANGELOG v0.6.340.
A callback whose valid single-use state is a reauth flow now returns
*auth.ReauthError for any failure, with marker failed (auth_time),
cancelled (IdP error=) or error (exchange, verification, nonce). The state
is consumed before the error= branch. The callback redirects to
safeNext(next)+reauth=<marker>; no session, no ConfirmedAt; one WARN.
The IdP error value is cut to 64 bytes. safeNext rejects any backslash.
UI: two new messages in four languages for the connect and approval dialogs.
docs/test: no long dash in edited lines (fix-895b)
All checks were successful
ci / test-and-build (pull_request) Successful in 4m24s
95c86172f8
Cordy merged commit 2abe1ca8b1 into main 2026-10-14 11:09:02 +00:00
Cordy deleted branch fix-895b 2026-10-14 11:09:04 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: Cordy/Cairn#899
No description provided.