Skip to content

Commit

Permalink
Bugfix in login check
Browse files Browse the repository at this point in the history
  • Loading branch information
pct960 committed Sep 21, 2019
1 parent a9b65e3 commit 30fbbd9
Showing 1 changed file with 32 additions and 14 deletions.
46 changes: 32 additions & 14 deletions iudx-api-server/src/main/java/iudx/http/HttpServerVerticle.java
Original file line number Diff line number Diff line change
Expand Up @@ -3817,29 +3817,47 @@ public void publish(HttpServerRequest req)

if(!pool.containsKey(id + ":" + apikey))
{
logger.debug("Pool does not contain key");
checkLogin(id, apikey)
.setHandler(login -> {

if(!login.succeeded())
{
forbidden(resp);
return;
}
if(!login.succeeded())
{
forbidden(resp);
return;
}

try
{
getChannel(id, apikey).basicPublish(exchange, topic, null, message.getBytes());
}
catch(Exception e)
{
error(resp, "Could not publish to broker");
return;
}

accepted(resp);
return;
});
}

try
{
getChannel(id, apikey).basicPublish(exchange, topic, null, message.getBytes());
}
catch(Exception e)
else
{
error(resp, "Could not publish to broker");
try
{
getChannel(id, apikey).basicPublish(exchange, topic, null, message.getBytes());
}
catch(Exception e)
{
error(resp, "Could not publish to broker");
return;
}

accepted(resp);
return;

}

accepted(resp);
return;
});
}

Expand Down

0 comments on commit 30fbbd9

Please sign in to comment.