Skip to content

Commit f35040c

Browse files
authored
Merge pull request #270 from Iterable/chore/jwt-same-auth-fix
Fixed the check for string equality by DT
2 parents c4c8ef4 + 2654731 commit f35040c

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

iterableapi/src/main/java/com/iterable/iterableapi/IterableApi.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,12 +220,18 @@ void setNotificationData(IterableNotificationData data) {
220220
}
221221

222222
void setAuthToken(String authToken) {
223+
setAuthToken(authToken, false);
224+
}
225+
226+
void setAuthToken(String authToken, boolean bypassAuth) {
223227
if (isInitialized()) {
224-
if (_authToken != authToken) {
228+
if ((authToken != null && !authToken.equalsIgnoreCase(_authToken)) || (_authToken != null && !_authToken.equalsIgnoreCase(authToken))) {
225229
_authToken = authToken;
226230
storeAuthData();
231+
onLogIn();
232+
} else if (bypassAuth) {
233+
onLogIn();
227234
}
228-
onLogIn();
229235
}
230236
}
231237

iterableapi/src/main/java/com/iterable/iterableapi/IterableAuthManager.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ public void onFailure(Throwable throwable) {
7070
}
7171

7272
} else {
73-
IterableApi.getInstance().setAuthToken(null);
73+
IterableApi.getInstance().setAuthToken(null, true);
7474
}
7575
}
7676

0 commit comments

Comments
 (0)