diff options
| author | Atul Patel (OpenERP) <atp@tinyerp.com> | 2014-02-18 11:26:18 +0530 |
|---|---|---|
| committer | Atul Patel (OpenERP) <atp@tinyerp.com> | 2014-02-18 11:26:18 +0530 |
| commit | 33b99c8a0737e08e6a243e41bb455d3ab7e6c851 (patch) | |
| tree | a1db52bfbeecf0c6fd9096604b7ec4540bb04197 /addons/auth_oauth_signup/controllers | |
| parent | caa3510ea434e10c32dcbc134f9c74b2b9f18b2a (diff) | |
| parent | aa0eac1257b97c1be693e8a804fec6ecbf2bb22f (diff) | |
[MERGE]: Merged with addons
bzr revid: atp@tinyerp.com-20140218055618-r36w29vat7zig9ar
Diffstat (limited to 'addons/auth_oauth_signup/controllers')
| -rw-r--r-- | addons/auth_oauth_signup/controllers/__init__.py | 3 | ||||
| -rw-r--r-- | addons/auth_oauth_signup/controllers/main.py | 20 |
2 files changed, 23 insertions, 0 deletions
diff --git a/addons/auth_oauth_signup/controllers/__init__.py b/addons/auth_oauth_signup/controllers/__init__.py new file mode 100644 index 00000000000..e11f9ba81bb --- /dev/null +++ b/addons/auth_oauth_signup/controllers/__init__.py @@ -0,0 +1,3 @@ +import main + +# vim:expandtab:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/auth_oauth_signup/controllers/main.py b/addons/auth_oauth_signup/controllers/main.py new file mode 100644 index 00000000000..0b8ab22cdaa --- /dev/null +++ b/addons/auth_oauth_signup/controllers/main.py @@ -0,0 +1,20 @@ +import openerp +import werkzeug + +from openerp.http import request + +class OAuthSignupLogin(openerp.addons.web.controllers.main.Home): + def list_providers(self): + providers = super(OAuthSignupLogin, self).list_providers() + if len(providers) == 1 and request.params.get('mode') == 'signup': + werkzeug.exceptions.abort(werkzeug.utils.redirect(providers[0]['auth_link'], 303)) + return providers + + def get_state(self, provider): + state = super(OAuthSignupLogin, self).get_state(provider) + token = request.params.get('token') + if token: + state['t'] = token + return state + +# vim:expandtab:tabstop=4:softtabstop=4:shiftwidth=4: |
