http response tooling written

This commit is contained in:
2025-12-30 14:42:04 -07:00
parent 493d15eae8
commit c01d700482
14 changed files with 660 additions and 60 deletions
+7 -6
View File
@@ -15,6 +15,7 @@ import (
"ruben/inventory2/internal/domains/authentication"
etsy_platform "ruben/inventory2/internal/domains/platforms/etsy"
"ruben/inventory2/internal/domains/raw_events"
"ruben/inventory2/internal/site/response"
)
type Server struct {
@@ -90,16 +91,16 @@ func NewServer(
// api routes
s.mux.HandleFunc("GET /login", s.loginPage)
s.mux.HandleFunc("GET /login/callback", s.loginCallback)
s.mux.HandleFunc("GET /logout", s.logoutPage)
s.mux.Handle("POST /accounts", s.authenticate(http.HandlerFunc(s.createAccount)))
s.mux.HandleFunc("GET /login", response.Handler(s.loginPage))
s.mux.HandleFunc("GET /login/callback", response.Handler(s.loginCallback))
s.mux.HandleFunc("GET /logout", response.Handler(s.logoutPage))
s.mux.Handle("POST /accounts", response.Handler(s.authenticate(s.createAccount)))
// TODO: eliminate once no longer used.
s.mux.HandleFunc("POST /login", s.login)
s.mux.HandleFunc("POST /login", response.Handler(s.login))
// TODO: get rid of this, once we're confident this isn't needed...
s.mux.Handle("GET /test-auth", s.authenticate(http.HandlerFunc(s.testAuthEndpoint)))
s.mux.Handle("GET /test-auth", response.Handler(s.authenticate(s.testAuthEndpoint)))
// webpage content