fix(dashboard): an expired sign-in goes to the login, and the evidence pack says why it failed #418

Merged
sharang merged 2 commits from fix/dashboard-token-refresh into main 2026-09-28 20:40:02 +00:00
2 Commits
Author SHA1 Message Date
Sharang ParnerkarandClaude Opus 5.5 1a28a80d83 fix(dashboard): the evidence pack downloads a ZIP or says why not
CI / Check (pull_request) Successful in 6m54s
CI / Check (push) Skipped
CI / Detect Changes (pull_request) Skipped
CI / Deploy Agent (pull_request) Skipped
CI / Deploy Dashboard (pull_request) Skipped
CI / Deploy Docs (pull_request) Skipped
CI / Deploy MCP (pull_request) Skipped
The download was a plain link. When the agent refused (an expired token,
the Mongo outage), the route answered with the app's own page, and the
browser saved that as <target id>.html: an empty white page. The button
now fetches the pack in the page: a ZIP is saved under the server's file
name; anything else shows "Das Nachweispaket konnte nicht erstellt werden"
(with the server's reason when it gave one in words), and an expired
sign-in goes to the login.

The file picker's own button uses the dashboard's button style.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EYKjxacrr6K88DruUmP48p
2026-09-28 22:32:35 +02:00
Sharang ParnerkarandClaude Opus 5.5 ecee3b5b50 fix(dashboard): an expired sign-in sends you to the login instead of failing every page
CI / Check (push) Skipped
CI / Detect Changes (pull_request) Skipped
CI / Deploy Agent (pull_request) Skipped
CI / Deploy Dashboard (pull_request) Skipped
CI / Deploy Docs (pull_request) Skipped
CI / Deploy MCP (pull_request) Skipped
CI / Check (pull_request) Canceled after 4m51s
On staging every page said "konnten nicht geladen werden" while the data
was intact: the agent rejected each request with an expired token, because
the dashboard's token refresh was refused by Keycloak (invalid_grant) and it
kept sending the stale token.

- One refresh at a time per session. A page's parallel requests all
  refreshed with the same refresh token, and Keycloak, which rotates it,
  rejects every one after the first. A request that waited uses the token
  the other one got.
- A refused refresh ends the sign-in: the session's user is removed and the
  server function answers session_expired. The app shell checks the sign-in
  every minute and on such an answer goes to the login; the auth check itself
  counts an unrefreshable sign-in as signed out.
- A failure that is not about the sign-in shows its reason and a retry on
  the targets page, instead of a bare "could not be loaded".

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EYKjxacrr6K88DruUmP48p
2026-09-28 22:27:45 +02:00