Skip to content

Commit

Permalink
[auth][netrc] Empty account fallback to login (#1299)
Browse files Browse the repository at this point in the history
  • Loading branch information
stevebarrau authored Jan 2, 2025
1 parent b23d625 commit c1ca608
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,13 @@ protected PasswordAuthentication getPasswordAuthentication() {
// to (by default) 3 times, which is not the behaviour we want.
return null;
}
return new PasswordAuthentication(
credential.account(), credential.password().toCharArray());

String userName = credential.account();
if (userName == null || userName.isEmpty()) {
userName = credential.login();
}

return new PasswordAuthentication(userName, credential.password().toCharArray());
}
};
builder = builder.authenticator(authenticator);
Expand Down

0 comments on commit c1ca608

Please sign in to comment.