refactor: use context fom middleware in handlers

This commit is contained in:
Stavros
2025-08-25 14:19:52 +03:00
parent ace22acdb2
commit e1d8ce3cb5
11 changed files with 142 additions and 57 deletions

View File

@@ -1,4 +1,4 @@
package middlewares
package middleware
import (
"fmt"
@@ -29,6 +29,14 @@ func NewContextMiddleware(config ContextMiddlewareConfig, auth *auth.Auth, provi
}
}
func (m *ContextMiddleware) Init() error {
return nil
}
func (m *ContextMiddleware) Name() string {
return "ContextMiddleware"
}
func (m *ContextMiddleware) Middleware() gin.HandlerFunc {
return func(c *gin.Context) {
cookie, err := m.Auth.GetSessionCookie(c)