Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Replaced invalidateToken method to clearToken #1243

Merged
merged 2 commits into from
Feb 22, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -303,10 +303,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;
try {
if (response.getStatusCode() == 401 && !received401) {
received401 = true;
GoogleAuthUtil.clearToken(context, token);
return true;
}
} catch (GoogleAuthException e) {
e.printStackTrace();
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we can just swallow the exception here. Why would these exceptions be thrown?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Resolved.

} catch (IOException e) {
e.printStackTrace();
}
return false;
}
Expand Down