diff options
| author | Fabien Meghazi <fme@openerp.com> | 2014-01-28 11:45:59 +0100 |
|---|---|---|
| committer | Fabien Meghazi <fme@openerp.com> | 2014-01-28 11:45:59 +0100 |
| commit | f959685bc7435d477f00f7ea62110dbd9f2ea050 (patch) | |
| tree | 9e8efcea34e1e22190a3fc56fc1e8ed1b6059a6c /addons/auth_oauth/controllers | |
| parent | d588e44d34a11303aa1a73c4811cd93819d53d04 (diff) | |
[IMP] auth_oauth_singup converted to server side controllers
bzr revid: fme@openerp.com-20140128104559-fafi73deyiplw7tx
Diffstat (limited to 'addons/auth_oauth/controllers')
| -rw-r--r-- | addons/auth_oauth/controllers/main.py | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/addons/auth_oauth/controllers/main.py b/addons/auth_oauth/controllers/main.py index 415d75685af..0e4d5572c52 100644 --- a/addons/auth_oauth/controllers/main.py +++ b/addons/auth_oauth/controllers/main.py @@ -47,10 +47,7 @@ class OAuthLogin(openerp.addons.web.controllers.main.Home): providers = [] for provider in providers: return_url = request.httprequest.url_root + 'auth_oauth/signin' - state = dict( - d=request.session.db, - p=provider['id'] - ) + state = self.get_state(provider) params = dict( debug=request.debug, response_type='token', @@ -63,10 +60,17 @@ class OAuthLogin(openerp.addons.web.controllers.main.Home): return providers + def get_state(self, provider): + return dict( + d=request.session.db, + p=provider['id'] + ) + @http.route() def web_login(self, *args, **kw): # TODO: ensure_db() request.disable_db = False + providers = self.list_providers() response = super(OAuthLogin, self).web_login(*args, **kw) if isinstance(response, LazyResponse): @@ -80,15 +84,10 @@ class OAuthLogin(openerp.addons.web.controllers.main.Home): else: error = None response.params['values'].update( - providers=self.list_providers(), + providers=providers, error=error, ) - # TODO: code in old js controller that should be converted in auth_oauth_signup - # if (this.oauth_providers.length === 1 && params.type === 'signup') { - # this.do_oauth_sign_in(this.oauth_providers[0]); - # } - return response class OAuthController(http.Controller): |
