Skip to content

Commit

Permalink
Merge pull request #43 from owncloud/fix-middlware-cache-hit
Browse files Browse the repository at this point in the history
  • Loading branch information
refs authored Jun 8, 2020
2 parents bfe4790 + 2e2e6c3 commit 9142f91
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
6 changes: 6 additions & 0 deletions changelog/unreleased/cache-miss-fix
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Bugfix: Accounts service response was ignored

We fixed an error in the AccountUUID middleware that was responsible for ignoring an account uuid
provided by the accounts service.

https://github.com/owncloud/ocis-proxy/pull/43
11 changes: 6 additions & 5 deletions pkg/middleware/account_uuid.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,13 +95,14 @@ func AccountUUID(opts ...AccountMiddlewareOption) func(next http.Handler) http.H
}

uuid = resp.Payload.Account.Uuid
} else {
uuid, ok = entry.V.(string)
if !ok {
w.WriteHeader(http.StatusInternalServerError)
return
}
}

uuid, ok = entry.V.(string)
if !ok {
w.WriteHeader(http.StatusInternalServerError)
return
}

l.Debug().Interface("claims", claims).Interface("uuid", uuid).Msgf("Associated claims with uuid")
token, err := tokenManager.MintToken(r.Context(), &revauser.User{
Expand Down

0 comments on commit 9142f91

Please sign in to comment.