Skip to content

Commit

Permalink
key creation endpoint fixed (#1995)
Browse files Browse the repository at this point in the history
  • Loading branch information
dencoded authored and buger committed Nov 27, 2018
1 parent b0b24e3 commit 79fd301
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions api.go
Original file line number Diff line number Diff line change
Expand Up @@ -988,6 +988,11 @@ func createKeyHandler(w http.ResponseWriter, r *http.Request) {

if len(newSession.AccessRights) > 0 {
for apiID := range newSession.AccessRights {
// reset API-level limit to nil if it has a zero-value
if access := newSession.AccessRights[apiID]; access.Limit != nil && *access.Limit == (user.APILimit{}) {
access.Limit = nil
newSession.AccessRights[apiID] = access
}
apiSpec := getApiSpec(apiID)
if apiSpec != nil {
checkAndApplyTrialPeriod(newKey, apiID, newSession)
Expand Down

0 comments on commit 79fd301

Please sign in to comment.