Skip to content

Commit

Permalink
fix: ignore discriminator if the value is "0"
Browse files Browse the repository at this point in the history
  • Loading branch information
wadahiro committed Nov 2, 2024
1 parent 05a3df4 commit 4c68b69
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,12 @@ protected String getProfileEndpointForValidation(EventBuilder event) {
protected BrokeredIdentityContext extractIdentityFromProfile(EventBuilder event, JsonNode profile) {
BrokeredIdentityContext user = new BrokeredIdentityContext(getJsonProperty(profile, "id"), getConfig());

user.setUsername(getJsonProperty(profile, "username") + "#" + getJsonProperty(profile, "discriminator"));
String username = getJsonProperty(profile, "username");
String discriminator = getJsonProperty(profile, "discriminator");
if (!discriminator.equals("0")) {
username = username + "#" + discriminator;
}
user.setUsername(username);
user.setEmail(getJsonProperty(profile, "email"));
user.setIdp(this);

Expand Down

0 comments on commit 4c68b69

Please sign in to comment.