Skip to content

Commit

Permalink
fix formatting
Browse files Browse the repository at this point in the history
Signed-off-by: marcelocamanho <mcamanho@zwift.com>
  • Loading branch information
marcelocamanho authored and ostrya committed Dec 10, 2021
1 parent 651ab16 commit 13ae11e
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -120,14 +120,15 @@ private void handlePasswordFlow(RoutingContext routingContext) {
private void handleClientCredentialsFlow(RoutingContext routingContext) {
String clientId = routingContext.request().getFormAttribute("client_id");
String password = routingContext.request().getFormAttribute("client_secret");
boolean formBasedAuth = clientId != null && !clientId.isEmpty() && password != null && !password.isEmpty();
boolean formBasedAuth =
clientId != null && !clientId.isEmpty() && password != null && !password.isEmpty();
final User user = routingContext.user();
if (user == null && !formBasedAuth) {
routingContext.fail(401);
return;
}

//if not form based, try using user (BASIC auth or custom)
// if not form based, try using user (BASIC auth or custom)
if (!formBasedAuth) {
clientId = routingContext.user().get("username");
// Password is a list of roles
Expand Down

0 comments on commit 13ae11e

Please sign in to comment.