It would be a lot easier to logout the client without getting all the token errors with client.destroy().
If you're getting token errors, it's because you're trying to send messages or do other things after calling client.destroy(). I don't think adding a new method that keeps the token stored just for REST methods is at all necessary.
Most helpful comment
If you're getting token errors, it's because you're trying to send messages or do other things after calling
client.destroy(). I don't think adding a new method that keeps the token stored just for REST methods is at all necessary.