[IMP] auth_oauth2: log provider error

bzr revid: fme@openerp.com-20121010121919-cefodm7vzat5z321
This commit is contained in:
Fabien Meghazi 2012-10-10 14:19:19 +02:00
parent f486bf1c9f
commit 94e4c0750e
2 changed files with 2 additions and 2 deletions

View File

@ -43,7 +43,7 @@ class OAuthController(openerpweb.Controller):
url = "/#action=login&oauth_error=1"
except Exception,e:
# signup error
_logger.exception('oops')
_logger.exception("OAuth2: %s" % str(e))
url = "/#action=login&oauth_error=2"
return openerp.addons.web.controllers.main.set_cookie_and_redirect(req, url)

View File

@ -41,7 +41,7 @@ class res_users(osv.Model):
validation = self.auth_oauth_rpc(cr, uid, p.validation_endpoint, access_token)
if validation.get("error"):
raise openerp.exceptions.AccessDenied
raise Exception(validation['error'])
if p.data_endpoint:
data = self.auth_oauth_rpc(cr, uid, p.data_endpoint, access_token)
validation.update(data)