mercadolibre / java-sdk

MercadoLibre's Java SDK
46 stars 65 forks source link

Refresh Token Status Code #10

Open molinama opened 9 years ago

molinama commented 9 years ago

When the access_token expired the sdk never try to use the refresh_token because when asking for the response status code, the Meli sdk is comparing it with the 404 Status Code (Not Found) instead of 401 (Auth error). This is the wrong code into the Meli.java

if (params.containsKey("access_token") && this.hasRefreshToken()
                && response.getStatusCode() == 404) {

It should be

if (params.containsKey("access_token") && this.hasRefreshToken()
                && response.getStatusCode() == 401) {