[IMP] Allow easy overloading for tokeninfo

bzr revid: fme@openerp.com-20120927134551-utlf98g775c9mqqs
This commit is contained in:
Fabien Meghazi
2012-09-27 15:45:51 +02:00
parent c962e0100d
commit a7b02e9eb0
@@ -76,6 +76,9 @@ class auth_oauth2_token(osv.TransientModel):
"expires_in": expires_in,
"audience": token.client,
}
return self._tokeninfo(r, token)
def _tokeninfo(self, r, token):
# Allows easy overloading
if token.user_id.email: # TODO: should deliver only according to scopes
r['email'] = token.user_id.email
return r