OAuth2AccessToken: Log attributes when an invalid token is found

This will help diagnose why these invalid tokens exist.
This commit is contained in:
Brian Simpson
2016-05-06 12:05:21 -07:00
parent 1cd16a762a
commit 420680e740

View File

@@ -643,6 +643,9 @@ class OAuth2AccessToken(Token):
client = OAuth2Client._byID(self.client_id)
if getattr(client, 'deleted', False):
raise NotFound
except AttributeError:
g.log.error("bad token %s: %s", self, self._t)
raise
except NotFound:
return False