added database connection and ability to retrieve "Anonymous Honyak" user

This commit is contained in:
2025-09-20 15:57:29 -06:00
parent 0e65eaeef6
commit a794c5919b
8 changed files with 119 additions and 0 deletions
+7
View File
@@ -12,6 +12,7 @@ package ui
import (
"git.erbosoft.com/amy/amsterdam/config"
"git.erbosoft.com/amy/amsterdam/database"
"github.com/gorilla/sessions"
log "github.com/sirupsen/logrus"
)
@@ -28,4 +29,10 @@ func SetupSessionManager() {
// SetupAmSession sets up a newly created Amsterdam session.
func SetupAmSession(session *sessions.Session) {
session.Values["temp"] = "Active"
u, err := database.AmGetAnonUser()
if err == nil {
session.Values["user"] = u
} else {
log.Errorf("Unable to load anon user: %v", err)
}
}