Phase 10, part 1: users, sessions and form tokens

Schema 32 adds users, memberships and sessions, on both databases.
internal/users keeps accounts (Argon2id passwords), roles and modules,
and sessions whose rows hold only a hash of the cookie's value; they end
after a week unused or 30 days. On the server edition, every page but the
public ones needs a session and sends others to /signin. Every edition's
forms now carry a CSRF token (a cookie repeated in each form, added as
pages render; htmx sends it as a header), besides the same-origin check.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-25 08:49:45 -07:00
co-authored by Claude Opus 5.5
parent d537fb367f
commit 96404a3580
21 changed files with 1475 additions and 21 deletions
+2 -2
View File
@@ -339,7 +339,7 @@ func probe(ctx context.Context, svc core.Service) serviceCheck {
// fragment, loaded after the page so a slow service doesn't hold it up.
func (s *Server) coreChecks(w http.ResponseWriter, r *http.Request) {
if s.Core == nil {
s.fragment(w, "core", "checks", nil)
s.fragment(w, r, "core", "checks", nil)
return
}
services := s.Core.Services()
@@ -353,7 +353,7 @@ func (s *Server) coreChecks(w http.ResponseWriter, r *http.Request) {
}(i, svc)
}
wg.Wait()
s.fragment(w, "core", "checks", checks)
s.fragment(w, r, "core", "checks", checks)
}
// --- AI servers CoreDesktop found ---