Skip to content
This repository was archived by the owner on Sep 28, 2022. It is now read-only.

Commit 8f07731

Browse files
author
Shiranuit
authored
Merge pull request #100 from kuzzleio/fix-token-expired
Fix token expired
2 parents ff19172 + 6f25165 commit 8f07731

1 file changed

Lines changed: 7 additions & 8 deletions

File tree

src/main/java/io/kuzzle/sdk/Kuzzle.java

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -197,16 +197,15 @@ protected void onResponseReceived(final Object... payload) {
197197
return;
198198
}
199199

200-
if (response.error.id == null
201-
|| !response.error.id.equals("security.token.expired")) {
202-
final Task<Response> task = requests.get(response.requestId);
203-
if (task != null) {
204-
task.setException(new ApiErrorException(response));
205-
}
206-
return;
200+
final Task<Response> task = requests.get(response.requestId);
201+
if (task != null) {
202+
task.setException(new ApiErrorException(response));
207203
}
204+
requests.remove(response.requestId);
208205

209-
super.trigger(Event.tokenExpired);
206+
if (response.error.id != null && response.error.id.equals("security.token.expired")) {
207+
super.trigger(Event.tokenExpired);
208+
}
210209
}
211210

212211
protected void onStateChanged(final Object... args) {

0 commit comments

Comments
 (0)