diff options
Diffstat (limited to 'pkg/ext')
-rw-r--r-- | pkg/ext/gorm_logger.go | 2 | ||||
-rw-r--r-- | pkg/ext/middleware.go | 5 |
2 files changed, 3 insertions, 4 deletions
diff --git a/pkg/ext/gorm_logger.go b/pkg/ext/gorm_logger.go index f0ab592..ddced21 100644 --- a/pkg/ext/gorm_logger.go +++ b/pkg/ext/gorm_logger.go @@ -3,9 +3,9 @@ package ext import ( "context" "fmt" - "log/slog" "time" + "golang.org/x/exp/slog" "gorm.io/gorm/logger" "gorm.io/gorm/utils" ) diff --git a/pkg/ext/middleware.go b/pkg/ext/middleware.go index 38bacca..d9f06e1 100644 --- a/pkg/ext/middleware.go +++ b/pkg/ext/middleware.go @@ -4,10 +4,11 @@ import ( "context" "encoding/base64" "errors" - "log/slog" "net/http" "time" + "golang.org/x/exp/slog" + "git.sr.ht/~gabrielgio/img/pkg/database/repository" "git.sr.ht/~gabrielgio/img/pkg/service" ) @@ -47,7 +48,6 @@ func (l *LogMiddleware) HTTP(next http.HandlerFunc) http.HandlerFunc { slog.Duration("elapsed", elapsed), slog.String("path", r.URL.Path), ) - } } @@ -135,7 +135,6 @@ func NewInitialSetupMiddleware(userRepository repository.UserRepository) *Initia func (i *InitialSetupMiddleware) Check(next http.HandlerFunc) http.HandlerFunc { return func(w http.ResponseWriter, r *http.Request) { - // if user has been set to context it is logged in already token := GetUserFromCtx(r) if token != nil { |