Add custom session

This commit is contained in:
2024-07-13 14:53:34 -04:00
parent 992ba29848
commit e0ebf2e6bb
4 changed files with 62 additions and 38 deletions

View File

@@ -7,15 +7,19 @@ import (
"strconv"
"time"
"github.com/gorilla/sessions"
_ "github.com/joho/godotenv/autoload"
"gothtest/internal/auth"
"gothtest/internal/database"
"gothtest/internal/session"
)
type Server struct {
port int
db database.Service
db database.Service
store sessions.Store
}
func NewServer() *http.Server {
@@ -23,8 +27,10 @@ func NewServer() *http.Server {
NewServer := &Server{
port: port,
db: database.New(),
db: database.New(),
store: session.New(),
}
auth.NewAuth(&NewServer.store)
// Declare Server config
server := &http.Server{