audit items

This commit is contained in:
jdl
2026-06-12 15:02:35 +02:00
parent 753f23cc03
commit 0b1d9e9da3
3 changed files with 4 additions and 4 deletions

View File

@@ -1,5 +1,5 @@
package hub
const (
SESSION_ID_COOKIE_NAME = "SessionID"
sessionIDCookieName = "SessionID"
)

View File

@@ -12,7 +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, SESSION_ID_COOKIE_NAME)
sessionID := app.getCookie(r, sessionIDCookieName)
s, err := app.api.Session_Get(sessionID)
if err != nil {
log.Printf("Failed to get session: %v", err)

View File

@@ -38,7 +38,7 @@ func (a *App) _signinSubmit(s *api.Session, w http.ResponseWriter, r *http.Reque
if err != nil {
return err
}
a.setCookie(w, SESSION_ID_COOKIE_NAME, sess.SessionID)
a.setCookie(w, sessionIDCookieName, sess.SessionID)
return a.redirect(w, r, "/")
}
@@ -51,7 +51,7 @@ func (a *App) _adminSignOutSubmit(s *api.Session, w http.ResponseWriter, r *http
if err := a.api.Session_Delete(s.SessionID); err != nil {
log.Printf("Failed to delete session cookie %s: %v", s.SessionID, err)
}
a.deleteCookie(w, SESSION_ID_COOKIE_NAME)
a.deleteCookie(w, sessionIDCookieName)
return a.redirect(w, r, "/")
}