Added documentation to functions and basic JWT generation

This commit is contained in:
2025-02-09 00:48:30 +11:00
parent 597fc6f072
commit 25868becf3
29 changed files with 254 additions and 58 deletions

View File

@@ -3,10 +3,12 @@ package server
import (
"database/sql"
"net/http"
"projectreshoot/handlers"
"projectreshoot/view/page"
)
// Add all the handled routes to the mux
func addRoutes(
mux *http.ServeMux,
config *Config,
@@ -23,5 +25,5 @@ func addRoutes(
// Login page and handlers
mux.Handle("GET /login", handlers.HandleLoginPage(config.TrustedHost))
mux.Handle("POST /login", handlers.HandleLoginRequest(conn))
mux.Handle("POST /login", handlers.HandleLoginRequest(conn, config.SecretKey))
}