Removed echo-contrib dependency.

This commit is contained in:
mikestefanello 2024-06-15 16:56:47 -04:00
parent 8eafb6b666
commit 75aefa8a0a
13 changed files with 108 additions and 18 deletions

View file

@ -11,12 +11,12 @@ import (
"time"
"github.com/mikestefanello/pagoda/ent"
"github.com/mikestefanello/pagoda/pkg/session"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/gorilla/sessions"
"github.com/labstack/echo-contrib/session"
"github.com/labstack/echo/v4"
)
@ -29,8 +29,7 @@ func NewContext(e *echo.Echo, url string) (echo.Context, *httptest.ResponseRecor
// InitSession initializes a session for a given Echo context
func InitSession(ctx echo.Context) {
mw := session.Middleware(sessions.NewCookieStore([]byte("secret")))
_ = ExecuteMiddleware(ctx, mw)
session.Store(ctx, sessions.NewCookieStore([]byte("secret")))
}
// ExecuteMiddleware executes a middleware function on a given Echo context