diff options
author | Gabriel Arakaki Giovanini <mail@gabrielgio.me> | 2023-07-04 18:38:10 +0200 |
---|---|---|
committer | Gabriel Arakaki Giovanini <mail@gabrielgio.me> | 2023-07-04 18:40:02 +0200 |
commit | 311ab744fe1bf278b18c25892497271988399e9a (patch) | |
tree | 89f956f521000ac0d22f815e91cab4cf00a8b70f /pkg/ext | |
parent | c2d666b43477ea7042b574ad940c508216cb0e83 (diff) | |
download | lens-311ab744fe1bf278b18c25892497271988399e9a.tar.gz lens-311ab744fe1bf278b18c25892497271988399e9a.tar.bz2 lens-311ab744fe1bf278b18c25892497271988399e9a.zip |
feat: Add user based files
Now files follow user path configuration
Diffstat (limited to 'pkg/ext')
-rw-r--r-- | pkg/ext/middleware.go | 8 |
1 files changed, 8 insertions, 0 deletions
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 } |