Massive refactor!

This commit is contained in:
2025-04-22 23:26:11 +01:00
parent 05bb05d45c
commit 5c3a847900
42 changed files with 597 additions and 301 deletions

View File

@@ -4,14 +4,16 @@ import (
"database/sql"
"net/http"
account "synlotto-website/handlers/account"
"synlotto-website/handlers"
"synlotto-website/middleware"
)
func SetupAccountRoutes(mux *http.ServeMux, db *sql.DB) {
mux.HandleFunc("/login", middleware.Protected(handlers.Login))
mux.HandleFunc("/logout", handlers.Logout)
mux.HandleFunc("/signup", middleware.Protected(handlers.Signup))
mux.HandleFunc("/login", middleware.Protected(account.Login))
mux.HandleFunc("/logout", account.Logout)
mux.HandleFunc("/signup", middleware.Protected(account.Signup))
mux.HandleFunc("/account/tickets/add_ticket", handlers.AddTicket(db))
mux.HandleFunc("/account/tickets/my_tickets", handlers.GetMyTickets(db))
mux.HandleFunc("/account/messages", middleware.Protected(handlers.MessagesInboxHandler(db)))