Skip to content

Commit

Permalink
inject license count
Browse files Browse the repository at this point in the history
  • Loading branch information
wardviaene committed Oct 15, 2024
1 parent d0cf3d6 commit 0b49ea0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
2 changes: 2 additions & 0 deletions rest/middleware.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import (
)

type CustomValue string
type CustomIntValue string

// auth middleware

Expand Down Expand Up @@ -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))
})
}
Expand Down
5 changes: 0 additions & 5 deletions rest/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
Expand Down

0 comments on commit 0b49ea0

Please sign in to comment.