Skip to content

Commit 20c3f47

Browse files
committed
Unmark as invalid when token can be refreshed
It is totally possible that the server (in a bad state) responds temporarily with an "invalid x" and on a retry actually refreshes the token. So we need to reset the flag ´self.invalid´.
1 parent 4c41593 commit 20c3f47

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

oauth2client/client.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -742,6 +742,9 @@ def _do_refresh_request(self, http_request):
742742
seconds=int(d['expires_in'])) + datetime.datetime.utcnow()
743743
else:
744744
self.token_expiry = None
745+
# On temporary refresh errors, the user does not actually have to
746+
# re-authorize, so we unflag here.
747+
self.invalid = False
745748
if self.store:
746749
self.store.locked_put(self)
747750
else:

0 commit comments

Comments
 (0)