Skip to content

Commit

Permalink
Issue open-horizon#628: admin credentials will no longer be added to …
Browse files Browse the repository at this point in the history
…the cache when they are not updated in the DB in PATCH /orgs/{orgid}/users/{username}

Signed-off-by: Ethan Weaver <emw0022@mix.wvu.edu>
  • Loading branch information
ewee33 committed Jun 27, 2022
1 parent ce5932e commit be7f87e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/scala/com/horizon/exchangeapi/UsersRoutes.scala
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ trait UsersRoutes extends JacksonSupport with AuthenticationSupport {
logger.debug("PATCH /orgs/" + orgid + "/users/" + username + " result: " + n)
if (n.asInstanceOf[Int] > 0) {
if (reqBody.password.isDefined) AuthCache.putUser(compositeId, hashedPw, reqBody.password.get)
if (reqBody.admin.isDefined) AuthCache.putUserIsAdmin(compositeId, reqBody.admin.get)
else if (reqBody.admin.isDefined) AuthCache.putUserIsAdmin(compositeId, reqBody.admin.get)
(HttpCode.POST_OK, ApiResponse(ApiRespType.OK, ExchMsg.translate("user.attr.updated", attrName, compositeId)))
} else {
(HttpCode.NOT_FOUND, ApiResponse(ApiRespType.NOT_FOUND, ExchMsg.translate("user.not.found", compositeId)))
Expand Down

0 comments on commit be7f87e

Please sign in to comment.