Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

TokenMiddleware is after JwtMiddleware, so we should assume that it always has a valid token

天舟d9f1b270b1a9
diff --git a/backend/server/jwt.go b/backend/server/jwt.go
index 3da8cbe347..0b96e16aba 100644
--- a/backend/server/jwt.go
+++ b/backend/server/jwt.go
@@ -151,10 +151,6 @@ func TokenMiddleware(l *bytebase.Logger, next echo.HandlerFunc) echo.HandlerFunc
return next(c)
}
- // If the user is not authenticated (no user token data in the context), don't do anything.
- if c.Get(GetTokenContextKey()) == nil {
- return next(c)
- }
// Gets user token from the context.
u := c.Get(GetTokenContextKey()).(*jwt.Token)