From 1b5939817ff82d4356dd4da00ea7d7a9bd448a3b Mon Sep 17 00:00:00 2001 From: Fabien Meghazi Date: Mon, 24 Sep 2012 18:02:13 +0200 Subject: [PATCH] [FIX] Return correct userid in tokeninfo bzr revid: fme@openerp.com-20120924160213-kfjdi6s01mcic9jp --- addons/auth_oauth_provider/controllers/main.py | 1 - addons/auth_oauth_provider/res_users.py | 2 +- addons/auth_oauth_provider/static/src/js/oauth_provider.js | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/addons/auth_oauth_provider/controllers/main.py b/addons/auth_oauth_provider/controllers/main.py index 7ca4ab75d56..944e3e44bf9 100644 --- a/addons/auth_oauth_provider/controllers/main.py +++ b/addons/auth_oauth_provider/controllers/main.py @@ -37,7 +37,6 @@ class AuthOAuthProvider(openerpweb.Controller): @openerpweb.httprequest def auth(self, req, **kw): - # TODO: if logged and approval_prompt == auto then return get_token and redirect search = req.params.copy() if req.debug: search['debug'] = 1 diff --git a/addons/auth_oauth_provider/res_users.py b/addons/auth_oauth_provider/res_users.py index 983672e0261..38200597730 100644 --- a/addons/auth_oauth_provider/res_users.py +++ b/addons/auth_oauth_provider/res_users.py @@ -49,7 +49,7 @@ class res_users(osv.osv): user = self.browse(cr, uid, user_id[0], context=context) if access_token == user.last_oauth_token: return { - "user_id": uid, + "user_id": user.id, "scope": user.last_oauth_token_scope, "email": user.partner_id.email or '', # TODO: should deliver only according to scopes "scope": user.last_oauth_token_scope, diff --git a/addons/auth_oauth_provider/static/src/js/oauth_provider.js b/addons/auth_oauth_provider/static/src/js/oauth_provider.js index a5e05c60283..f08b098efed 100644 --- a/addons/auth_oauth_provider/static/src/js/oauth_provider.js +++ b/addons/auth_oauth_provider/static/src/js/oauth_provider.js @@ -21,7 +21,7 @@ instance.auth_oauth_provider.ProviderAction = instance.web.Widget.extend({ // that should be displayed in the approval confirmation dialog. if (!this._error) { - // params.approval_prompt TODO + // params.approval_prompt TODO --> add 'none' (default) // TODO: get client_id and scope this.$('.oe_oauth_provider_approval').show().on('click', '.oe_oauth_provider_allow', function() { instance.session.rpc('/oauth2/get_token', {