Closed ihrthk closed 8 years ago
public Observable<T> get(String keyToken, Class<T> classToken) { T response = retrieve(keyToken, classToken); if (response != null) { if (response instanceof OAuth2AccessToken) { if (!((OAuth2AccessToken)response).isExpired()) { return Observable.just(response); } } else { return Observable.just(response); } } return null; }
When the token is expired a null value is returned. So, the calling method knows that way that it is required to ask for a new token.