Add custom session
This commit is contained in:
@@ -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{
|
||||
|
||||
Reference in New Issue
Block a user