[FIX] Check that redirect uri is distinct that original uri in fragment_to_query_string, else with redirect to root website. That avoid a loop if some route calling this function are called without hash

bzr revid: jke@openerp.com-20140228095422-4xzxfsv20s4zepxq
This commit is contained in:
Kersten Jeremy
2014-02-28 10:54:22 +01:00
+6
View File
@@ -15,6 +15,7 @@ from openerp.tools.translate import _
_logger = logging.getLogger(__name__)
#----------------------------------------------------------
# helpers
#----------------------------------------------------------
@@ -30,11 +31,15 @@ def fragment_to_query_string(func):
var s = l.search ? (l.search === '?' ? '' : '&') : '?';
r = l.pathname + l.search + s + q;
}
if (r == l) {
r = '/';
}
window.location = r;
</script></head><body></body></html>"""
return func(self, *a, **kw)
return wrapper
#----------------------------------------------------------
# Controller
#----------------------------------------------------------
@@ -88,6 +93,7 @@ class OAuthLogin(openerp.addons.web.controllers.main.Home):
return response
class OAuthController(http.Controller):
@http.route('/auth_oauth/signin', type='http', auth='none')