refactor: Update tenant ID handling across the application
This commit is contained in:
@@ -104,7 +104,7 @@ func Auth(tenantService interfaces.TenantService, userService interfaces.UserSer
|
||||
// Verify API key validity (matches the one in database)
|
||||
t, err := tenantService.GetTenantByID(c.Request.Context(), tenantID)
|
||||
if err != nil {
|
||||
log.Printf("Error getting tenant by ID: %v, tenantID: %d, apiKey: %s", err, tenantID, apiKey)
|
||||
log.Printf("Error getting tenant by ID: %v, tenantID: %d", err, tenantID)
|
||||
c.JSON(http.StatusUnauthorized, gin.H{
|
||||
"error": "Unauthorized: invalid API key",
|
||||
})
|
||||
|
||||
@@ -11,7 +11,6 @@ import (
|
||||
"go.opentelemetry.io/otel/codes"
|
||||
|
||||
"github.com/Tencent/WeKnora/internal/tracing"
|
||||
"github.com/Tencent/WeKnora/internal/types"
|
||||
)
|
||||
|
||||
// Custom ResponseWriter to capture response content
|
||||
@@ -36,12 +35,6 @@ func TracingMiddleware() gin.HandlerFunc {
|
||||
return
|
||||
}
|
||||
|
||||
// Get request ID as Span ID
|
||||
requestID := c.GetString(string(types.RequestIDContextKey))
|
||||
if requestID == "" {
|
||||
requestID = c.GetHeader("X-Request-ID")
|
||||
}
|
||||
|
||||
// Create new span
|
||||
spanName := fmt.Sprintf("%s %s", c.Request.Method, c.FullPath())
|
||||
ctx, span := tracing.ContextWithSpan(c.Request.Context(), spanName)
|
||||
|
||||
Reference in New Issue
Block a user