Skip to content

Commit

Permalink
Fix Replaced invalidateToken method to clearToken (#1243)
Browse files Browse the repository at this point in the history
* Replaced invalidateToken method to clearToken

* Fix throw exception
  • Loading branch information
Praful Makani authored and sduskis committed Feb 22, 2019
1 parent cba5f27 commit 41fac3b
Showing 1 changed file with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -301,12 +301,16 @@ public void intercept(HttpRequest request) throws IOException {
}

@Override
public boolean handleResponse(
HttpRequest request, HttpResponse response, boolean supportsRetry) {
if (response.getStatusCode() == 401 && !received401) {
received401 = true;
GoogleAuthUtil.invalidateToken(context, token);
return true;
public boolean handleResponse(HttpRequest request, HttpResponse response, boolean supportsRetry)
throws IOException {
try {
if (response.getStatusCode() == 401 && !received401) {
received401 = true;
GoogleAuthUtil.clearToken(context, token);
return true;
}
} catch (GoogleAuthException e) {
throw new GoogleAuthIOException(e);
}
return false;
}
Expand Down

0 comments on commit 41fac3b

Please sign in to comment.