diff --git a/addons/auth_oauth/__openerp__.py b/addons/auth_oauth/__openerp__.py index 4b162695e86..76f15687eb9 100644 --- a/addons/auth_oauth/__openerp__.py +++ b/addons/auth_oauth/__openerp__.py @@ -33,6 +33,7 @@ Allow users to login through OAuth2 Provider. 'website': 'http://www.openerp.com', 'depends': ['base', 'web', 'base_setup'], 'data': [ + 'res_users.xml', 'auth_oauth_data.xml', 'auth_oauth_data.yml', 'auth_oauth_view.xml', diff --git a/addons/auth_oauth/controllers/main.py b/addons/auth_oauth/controllers/main.py index dfcb21e91b2..415d75685af 100644 --- a/addons/auth_oauth/controllers/main.py +++ b/addons/auth_oauth/controllers/main.py @@ -1,3 +1,4 @@ +import functools import logging import simplejson @@ -14,6 +15,26 @@ from openerp.tools.translate import _ _logger = logging.getLogger(__name__) +#---------------------------------------------------------- +# helpers +#---------------------------------------------------------- +def fragment_to_query_string(func): + @functools.wraps(func) + def wrapper(self, *a, **kw): + if not kw: + return """""" + return func(self, *a, **kw) + return wrapper + #---------------------------------------------------------- # Controller #---------------------------------------------------------- @@ -73,6 +94,7 @@ class OAuthLogin(openerp.addons.web.controllers.main.Home): class OAuthController(http.Controller): @http.route('/auth_oauth/signin', type='http', auth='none') + @fragment_to_query_string def signin(self, **kw): state = simplejson.loads(kw['state']) dbname = state['d'] diff --git a/addons/auth_oauth/res_users.xml b/addons/auth_oauth/res_users.xml index 995dbfbd52a..feae1b16138 100644 --- a/addons/auth_oauth/res_users.xml +++ b/addons/auth_oauth/res_users.xml @@ -10,7 +10,7 @@ - +