From 1af505196ad217b91169cdac771de2ec0a35482f Mon Sep 17 00:00:00 2001 From: djpbessems Date: Sun, 10 Mar 2024 22:48:34 +1100 Subject: [PATCH] fix: Add error handling to session store --- pkg/spamasaurusrex/main.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pkg/spamasaurusrex/main.go b/pkg/spamasaurusrex/main.go index 7f00e35..00ed903 100644 --- a/pkg/spamasaurusrex/main.go +++ b/pkg/spamasaurusrex/main.go @@ -52,7 +52,12 @@ func callbackHandler(w http.ResponseWriter, r *http.Request) { } // Store the token in the session - session, _ := sessionStore.Get(r, "spamasaurusRex") + session, err := sessionStore.Get(r, "spamasaurusRex") + if err != nil { + log.Println(spew.Sdump(err)) + return + } + session.Values["token"] = token session.Save(r, w)