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:
parent
4eb27543e5
commit
4d5a65a185
1 changed files with 187 additions and 9 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue