Watch
0
0
Fork
You've already forked hyperhive
0

swarm-ui: a request that finds the login ended reloads the page to the login

The gateway answered every non-page request without a session with a login
redirect, which fetch and EventSource cannot follow across origins, so polls,
forms and streams failed with errors that said nothing about the session. It
now answers anything that does not ask for text/html with a 401 and a
WWW-Authenticate header, and the swarm UI reloads on that 401, from a wrapped
fetch (one place for every call) and from a probe after a stream dies. A second
reload within ten seconds is skipped so a page that keeps answering 401 cannot
loop. The proxy test and the docs follow.
This commit is contained in:
iris 2026-10-28 18:14:58 +01:00 • committed by mara
commit 4d5a65a185

View file

@ -805,6 +805,16 @@ Why a group and not "any session": agents are authelia subjects too, so
_authenticated_ includes every agent in the swarm. The group is the only
thing standing between "an operator's page" and "anyone with a session."
## When your login ends
When the session ends while a page is open, the page's next `/api/` request (a
poll, a form, or a stream that dies) gets a plain 401 with a
`WWW-Authenticate` header from the gateway, and the page reloads. The reload
lands on the login and, after you log in, back on the same address. A page
request still gets the login redirect, and `swarmctl --swarm` still treats the
401 as a sign to log in again. The page skips a second reload within ten
seconds, so a page that keeps answering 401 can't loop.
## What it costs to be reachable
hyperhive publishes the apex to the hive's resolver like every other