Skip to content

Commit 58dcf29

Browse files
authored
Merge pull request #709 from Iterable/MOB-6832-AuthDecode-crash-issue-fix
[MOB-6832] - AuthDecode crash fix
2 parents ed4b68d + e4055d2 commit 58dcf29

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,10 @@ public void run() {
156156
private static long decodedExpiration(String encodedJWT) throws Exception {
157157
long exp = 0;
158158
String[] split = encodedJWT.split("\\.");
159+
//Check if jwt is valid
160+
if (split.length != 3) {
161+
throw new IllegalArgumentException("Invalid JWT");
162+
}
159163
String body = getJson(split[1]);
160164
JSONObject jObj = new JSONObject(body);
161165
exp = jObj.getLong(expirationString);

0 commit comments

Comments
 (0)