Accounts are centralized in AuthGuard now, so this project's own "first launch, create the admin account" flow needs to know whether AuthGuard already has one - not just whether *this* project's local setup has been claimed. A fresh instance pointed at an AuthGuard that already has a superadmin (created via AuthGuard's own web UI, or a sibling project's setup) was incorrectly still showing its own create-account form. Both the status check and the setup/registration handler now also consult AuthGuard's GET /api/setup-status (via the vendored authclient's new SetupStatus method) before deciding: if AuthGuard already has an account, show the login screen instead, and reject a setup attempt that reaches the handler anyway (e.g. a stale page) the same way an already-claimed local setup is rejected. Also updates the vendored shared/backend/authclient to add PublicUser's totp_enabled field (AuthGuard has reported it for a while; the client just hadn't picked it up). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Shared Go backend packages
The Go packages under this directory hold infrastructure shared by the services, not application-specific SQL or HTTP handlers.
config— environment string, required value, boolean, integer, and duration helpers.postgres— validatedDATABASE_URLconfiguration,pgxpoolcreation/ping, transaction wrapper, and PostgreSQL error classification.auth— shared bcrypt policy, secure token generation/hashing, account/session schema, and account/session persistence.authclient— HTTP client andnet/httpmiddleware for services that adopt the centralized AuthServer instead of embeddingauthagainst their own database.migrate— embedded filesystem adapter for Goose migrations.logshipper— client adapter for LoggingServer (Web/LoggingServer): batches and ships log entries centrally while mirroring the same human-readable output and Debug/Info/Warn/Error/Critical/Audit/*Ctx method surface as each project's local internal/logging package.
Run go test ./... and go vet ./... from this directory. The module path is
repos.gfranz.ch/Gabriel20xx/shared/backend; change it if the shared folder is
hosted under a different repository path.
Application-specific table definitions and HTTP behavior stay in the service. That lets a service reuse reliable connection/auth plumbing without coupling its domain model to another project.