From dcf12304143ea6292ddfbeb5deabf51cc56d8a51 Mon Sep 17 00:00:00 2001 From: Harry Culpan Date: Tue, 30 Jun 2026 18:35:18 -0400 Subject: [PATCH] Handle GenerateJWTAndStoreInCookie error in setupHandler A JWT signing failure was silently ignored, leaving the user on the setup page with no auth cookie and no explanation for subsequent 401s. Co-Authored-By: Claude Sonnet 4.6 --- cmd/web/setuphandler.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cmd/web/setuphandler.go b/cmd/web/setuphandler.go index 7366619..3b6442b 100644 --- a/cmd/web/setuphandler.go +++ b/cmd/web/setuphandler.go @@ -23,7 +23,10 @@ func setupHandler(w http.ResponseWriter, r *http.Request) { return } - GenerateJWTAndStoreInCookie(w, appKey) + if err := GenerateJWTAndStoreInCookie(w, appKey); err != nil { + http.Error(w, "Failed to create session", http.StatusInternalServerError) + return + } } comp := templates.Setup(session)