diff options
| author | Antony Lesuisse <al@openerp.com> | 2012-08-16 00:47:08 +0200 |
|---|---|---|
| committer | Antony Lesuisse <al@openerp.com> | 2012-08-16 00:47:08 +0200 |
| commit | 23178302c4c44034e0bf6b6b1ea1a60d42e7d41c (patch) | |
| tree | 83317334646cb394af01b2b6783719d02da3a9e0 /addons/auth_oauth/controllers/main.py | |
| parent | 35e620ce688d07fd7ff6b0f50510c2c9301d2c7a (diff) | |
oauth generic with buttons from zocial
bzr revid: al@openerp.com-20120815224708-rcge3914klkwrw6u
Diffstat (limited to 'addons/auth_oauth/controllers/main.py')
| -rw-r--r-- | addons/auth_oauth/controllers/main.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/addons/auth_oauth/controllers/main.py b/addons/auth_oauth/controllers/main.py index a3f69954812..28f550b4bda 100644 --- a/addons/auth_oauth/controllers/main.py +++ b/addons/auth_oauth/controllers/main.py @@ -1,5 +1,6 @@ import logging +import simplejson import werkzeug.urls import werkzeug.utils @@ -22,12 +23,14 @@ class OAuthController(openerpweb.Controller): @openerpweb.httprequest def signin(self, req, **kw): - dbname = kw.get("state") + state = simplejson.loads(kw['state']) + dbname = state['d'] + provider = state['p'] registry = openerp.modules.registry.RegistryManager.get(dbname) with registry.cursor() as cr: try: u = registry.get('res.users') - credentials = u.auth_oauth(cr, 1, {}, kw) + credentials = u.auth_oauth(cr, 1, provider, kw) cr.commit() return openerp.addons.web.controllers.main.login_and_redirect(req, *credentials) except AttributeError: |
