diff --git a/centrifuge/src/main/java/io/github/centrifugal/centrifuge/Client.java b/centrifuge/src/main/java/io/github/centrifugal/centrifuge/Client.java index e78b137..6cfe1a6 100644 --- a/centrifuge/src/main/java/io/github/centrifugal/centrifuge/Client.java +++ b/centrifuge/src/main/java/io/github/centrifugal/centrifuge/Client.java @@ -673,6 +673,7 @@ private void handleConnectReply(Protocol.Reply reply) { this.handleConnectionError(new ReplyError(reply.getError().getCode(), reply.getError().getMessage(), reply.getError().getTemporary())); if (reply.getError().getCode() == 109) { // Token expired. this.refreshRequired = true; + this.data = null; this.ws.close(NORMAL_CLOSURE_STATUS, ""); } else if (reply.getError().getTemporary()) { this.ws.close(NORMAL_CLOSURE_STATUS, ""); diff --git a/centrifuge/src/main/java/io/github/centrifugal/centrifuge/Subscription.java b/centrifuge/src/main/java/io/github/centrifugal/centrifuge/Subscription.java index 194906d..f93cad8 100644 --- a/centrifuge/src/main/java/io/github/centrifugal/centrifuge/Subscription.java +++ b/centrifuge/src/main/java/io/github/centrifugal/centrifuge/Subscription.java @@ -236,6 +236,7 @@ void subscribeError(ReplyError err) { this.listener.onError(this, new SubscriptionErrorEvent(new SubscriptionSubscribeError(err))); if (err.getCode() == 109) { // Token expired. this.token = ""; + this.data = null; this.scheduleResubscribe(); } if (err.isTemporary()) { this.scheduleResubscribe();