From 311ab744fe1bf278b18c25892497271988399e9a Mon Sep 17 00:00:00 2001 From: Gabriel Arakaki Giovanini Date: Tue, 4 Jul 2023 18:38:10 +0200 Subject: feat: Add user based files Now files follow user path configuration --- pkg/ext/middleware.go | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'pkg/ext') diff --git a/pkg/ext/middleware.go b/pkg/ext/middleware.go index c83b998..2dd1cca 100644 --- a/pkg/ext/middleware.go +++ b/pkg/ext/middleware.go @@ -92,6 +92,14 @@ func (a *AuthMiddleware) LoggedIn(next fasthttp.RequestHandler) fasthttp.Request } } +func GetTokenFromCtx(ctx *fasthttp.RequestCtx) *Token { + tokenValue := ctx.UserValue("token") + if token, ok := tokenValue.(*Token); ok { + return token + } + return nil +} + type InitialSetupMiddleware struct { userRepository repository.UserRepository } -- cgit v1.2.3