goipam/db/sessionstore.go

15 lines
387 B
Go
Raw Permalink Normal View History

2024-02-22 10:18:59 +01:00
package db
import (
"github.com/gin-contrib/sessions"
gormsessions "github.com/gin-contrib/sessions/gorm"
"github.com/spf13/viper"
)
func CreateStore() sessions.Store {
sessionKey := viper.GetString("web.sessionkey")
// moved to memory stored sessions, ideally switching back to GORM if I can fix it
store := gormsessions.NewStore(conn, true, []byte(sessionKey))
return store
}