From 3dcd1c1080e8e773482f94f8d6d10c3b663fe55f Mon Sep 17 00:00:00 2001 From: jdl Date: Sat, 13 Jun 2026 14:45:23 +0200 Subject: [PATCH] WIP --- hub/handler.go | 8 +------- hub/handlers.go | 5 +---- 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/hub/handler.go b/hub/handler.go index 13bfe50..2614621 100644 --- a/hub/handler.go +++ b/hub/handler.go @@ -1,7 +1,6 @@ package hub import ( - "log" "net/http" "vppn/hub/api" @@ -13,12 +12,7 @@ type handlerFunc func(s *api.Session, w http.ResponseWriter, r *http.Request) er func (app *App) handlePub(pattern string, fn handlerFunc) { wrapped := func(w http.ResponseWriter, r *http.Request) { sessionID := app.getCookie(r, sessionIDCookieName) - s, err := app.api.Session_Get(sessionID) - if err != nil { - log.Printf("Failed to get session: %v", err) - http.Error(w, "Internal error", http.StatusInternalServerError) - return - } + s := app.api.Session_Get(sessionID) if r.Method == http.MethodPost { r.ParseMultipartForm(64 * 1024) diff --git a/hub/handlers.go b/hub/handlers.go index 818925b..80fb16c 100644 --- a/hub/handlers.go +++ b/hub/handlers.go @@ -3,7 +3,6 @@ package hub import ( "encoding/json" "errors" - "log" "net/http" "vppn/hub/api" "vppn/m" @@ -48,9 +47,7 @@ func (a *App) _adminSignOut(s *api.Session, w http.ResponseWriter, r *http.Reque } func (a *App) _adminSignOutSubmit(s *api.Session, w http.ResponseWriter, r *http.Request) error { - if err := a.api.Session_Delete(s.SessionID); err != nil { - log.Printf("Failed to delete session cookie %s: %v", s.SessionID, err) - } + a.api.Session_Delete(s.SessionID) a.deleteCookie(w, sessionIDCookieName) return a.redirect(w, r, "/") }