diff --git a/rest/middleware.go b/rest/middleware.go index a7e2dd4..7d43397 100644 --- a/rest/middleware.go +++ b/rest/middleware.go @@ -14,6 +14,7 @@ import ( ) type CustomValue string +type CustomIntValue string // auth middleware @@ -141,6 +142,7 @@ func (c *Context) injectUserMiddleware(next http.Handler) http.Handler { } ctx := context.WithValue(r.Context(), CustomValue("user"), user) + ctx = context.WithValue(ctx, CustomIntValue("licenseUserCount"), c.LicenseUserCount) next.ServeHTTP(w, r.WithContext(ctx)) }) } diff --git a/rest/types.go b/rest/types.go index f961dba..4182d2f 100644 --- a/rest/types.go +++ b/rest/types.go @@ -119,11 +119,6 @@ type LicenseResponse struct { Key string `json:"key,omitempty"` } -type ConnectionLicenseResponse struct { - LicenseUserCount int `json:"licenseUserCount"` - ConnectionCount int `json:"connectionCount"` -} - type JwtHeader struct { Alg string `json:"alg"` Typ string `json:"typ"`