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 <noreply@anthropic.com>
This commit is contained in:
Harry Culpan 2026-06-30 18:35:18 -04:00
parent e6e8d255bd
commit dcf1230414

View file

@ -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)