feat(auth): enhance authentication flow with TOTP and admin reset features
Docker / Docker Build & Push (push) Failing after 56s
Lint / Lint (push) Successful in 25s
Tests / Go backend (push) Failing after 19s
Tests / Dashboard checks (push) Successful in 24s

- Added TOTP setup, enable, and disable functions to the API.
- Implemented admin reset request and confirmation functionalities.
- Updated AuthPage to handle new reset functionalities and TOTP inputs.
- Enhanced auth store to manage user creation, deletion, and listing.
- Improved AppShell and SettingsDialog to support user management features.
- Refactored API calls for better organization and clarity.
This commit is contained in:
Gabriel20xx committed 2026-08-05 14:58:07 +02:00
1 parent ac08be0248
commit 652e81dacb
9 files changed
+4333 -3737

No files matched your search

+11
View File
@@ -117,10 +117,21 @@ func (s *Server) registerRoutes(mux *http.ServeMux, webRoot fs.FS) {
// Health and auth bootstrap routes are intentionally public.
mux.HandleFunc("GET /health", s.handleHealth)
mux.HandleFunc("GET /api/auth/status", s.auth.handleStatus)
mux.HandleFunc("POST /api/auth/reset/request", s.auth.handleResetRequest)
mux.HandleFunc("POST /api/auth/reset/confirm", s.auth.handleResetConfirm)
mux.HandleFunc("POST /api/auth/setup", s.auth.handleSetup)
mux.HandleFunc("POST /api/auth/login", s.auth.handleLogin)
mux.Handle("POST /api/auth/logout", s.auth.requireSession(s.auth.handleLogout))
mux.Handle("POST /api/auth/credentials", s.auth.requireSession(s.auth.handleUpdateCredentials))
mux.Handle("GET /api/auth/users", s.auth.requireSession(s.auth.handleUsers))
mux.Handle("POST /api/auth/users", s.auth.requireSession(s.auth.handleUsers))
mux.Handle("PUT /api/auth/users/{id}", s.auth.requireSession(s.auth.handleUser))
mux.Handle("PATCH /api/auth/users/{id}", s.auth.requireSession(s.auth.handleUser))
mux.Handle("DELETE /api/auth/users/{id}", s.auth.requireSession(s.auth.handleUser))
mux.Handle("GET /api/auth/totp/status", s.auth.requireSession(s.auth.handleTOTPStatus))
mux.Handle("POST /api/auth/totp/setup", s.auth.requireSession(s.auth.handleTOTPSetup))
mux.Handle("POST /api/auth/totp/enable", s.auth.requireSession(s.auth.handleTOTPEnable))
mux.Handle("POST /api/auth/totp/disable", s.auth.requireSession(s.auth.handleTOTPDisable))
mux.Handle("GET /api/auth/token/status", s.auth.requireSession(s.auth.handleTokenStatus))
mux.Handle("POST /api/auth/token/regenerate", s.auth.requireSession(s.auth.handleTokenRegenerate))