Added logging to loginform and added loading feedback for user on submit

This commit is contained in:
2025-02-09 18:57:27 +11:00
parent 378840fe24
commit 418cff1c4a
4 changed files with 28 additions and 6 deletions

View File

@@ -6,11 +6,14 @@ import (
"projectreshoot/handlers"
"projectreshoot/view/page"
"github.com/rs/zerolog"
)
// Add all the handled routes to the mux
func addRoutes(
mux *http.ServeMux,
logger *zerolog.Logger,
config *Config,
conn *sql.DB,
) {
@@ -25,5 +28,9 @@ func addRoutes(
// Login page and handlers
mux.Handle("GET /login", handlers.HandleLoginPage(config.TrustedHost))
mux.Handle("POST /login", handlers.HandleLoginRequest(conn, config.SecretKey))
mux.Handle("POST /login", handlers.HandleLoginRequest(
logger,
conn,
config.SecretKey,
))
}

View File

@@ -18,6 +18,7 @@ func NewServer(
mux := http.NewServeMux()
addRoutes(
mux,
logger,
config,
conn,
)