Merge remote-tracking branch 'upstream/master'
This commit is contained in:
commit
a180c6b896
2 changed files with 9 additions and 7 deletions
|
@ -173,7 +173,7 @@ public class KeycloakInstalled {
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getTokenString(long minValidity, TimeUnit unit) throws VerificationException, IOException, ServerRequest.HttpFailure {
|
public String getTokenString(long minValidity, TimeUnit unit) throws VerificationException, IOException, ServerRequest.HttpFailure {
|
||||||
long expires = token.getExpiration() * 1000 - unit.toMillis(minValidity);
|
long expires = ((long) token.getExpiration()) * 1000 - unit.toMillis(minValidity);
|
||||||
if (expires < System.currentTimeMillis()) {
|
if (expires < System.currentTimeMillis()) {
|
||||||
refreshToken();
|
refreshToken();
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,12 +34,14 @@ public class SocialUser {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setName(String name) {
|
public void setName(String name) {
|
||||||
int i = name.lastIndexOf(' ');
|
if (name != null) {
|
||||||
if (i != -1) {
|
int i = name.lastIndexOf(' ');
|
||||||
firstName = name.substring(0, i);
|
if (i != -1) {
|
||||||
lastName = name.substring(i + 1);
|
firstName = name.substring(0, i);
|
||||||
} else {
|
lastName = name.substring(i + 1);
|
||||||
firstName = name;
|
} else {
|
||||||
|
firstName = name;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue