Browse Source
fix: eliminate the possibility of NullPointerException (#56)
* fix: eliminate the possibility of NullPointerException
* build: fix release build
---------
Co-authored-by: Ryan Peper <ryan.peper@outlook.com>
master
Hiroyuki Wada
2 months ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with
12 additions and
3 deletions
-
.releaserc
-
pom.xml
-
src/main/java/org/keycloak/social/discord/DiscordIdentityProvider.java
|
|
@ -9,7 +9,7 @@ |
|
|
|
[ |
|
|
|
"@terrestris/maven-semantic-release", |
|
|
|
{ |
|
|
|
"mavenTarget": "install", |
|
|
|
"mavenTarget": "deploy", |
|
|
|
"clean": false, |
|
|
|
"updateSnapshotVersion": true, |
|
|
|
"settingsPath": "/home/runner/.m2/settings.xml", |
|
|
|
|
|
@ -52,6 +52,13 @@ |
|
|
|
<target>17</target> |
|
|
|
</configuration> |
|
|
|
</plugin> |
|
|
|
<plugin> |
|
|
|
<artifactId>maven-deploy-plugin</artifactId> |
|
|
|
<version>3.1.3</version> |
|
|
|
<configuration> |
|
|
|
<skip>true</skip> |
|
|
|
</configuration> |
|
|
|
</plugin> |
|
|
|
</plugins> |
|
|
|
</build> |
|
|
|
</project> |
|
|
@ -71,9 +71,11 @@ public class DiscordIdentityProvider extends AbstractOAuth2IdentityProvider<Disc |
|
|
|
|
|
|
|
String username = getJsonProperty(profile, "username"); |
|
|
|
String discriminator = getJsonProperty(profile, "discriminator"); |
|
|
|
if (!discriminator.equals("0")) { |
|
|
|
username = username + "#" + discriminator; |
|
|
|
|
|
|
|
if (!"0".equals(discriminator)) { |
|
|
|
username += "#" + discriminator; |
|
|
|
} |
|
|
|
|
|
|
|
user.setUsername(username); |
|
|
|
user.setEmail(getJsonProperty(profile, "email")); |
|
|
|
user.setIdp(this); |
|
|
|