[OAuth2] Don't send unnecessary modhash to OAuth clients

This commit is contained in:
Keith Mitchell
2014-04-14 11:16:46 -07:00
parent 4150c399ee
commit d6848c8d14

View File

@@ -273,6 +273,11 @@ class Account(Thing):
return not g.disable_captcha and self.link_karma < 1
def modhash(self, rand=None, test=False):
if c.oauth_user:
# OAuth clients should never receive a modhash of any kind
# as they could use it in a CSRF attack to bypass their
# permitted OAuth scopes.
return None
return modhash(self, rand = rand, test = test)
def valid_hash(self, hash):