diff options
| author | Fabien Meghazi <fme@openerp.com> | 2014-03-12 12:21:41 +0100 |
|---|---|---|
| committer | Fabien Meghazi <fme@openerp.com> | 2014-03-12 12:21:41 +0100 |
| commit | 2ed053642abfbf20678c02955b8b0bb575cf8d30 (patch) | |
| tree | faa0cd19bccee19ec6425cf979369ad8bbb04727 | |
| parent | 9684f077358091c0eccf30abb2dfecd83fb0eb4a (diff) | |
[IMP] oaut & signup, redirect if already logged in
bzr revid: fme@openerp.com-20140312112141-uvo89w4ovmzq5ozq
| -rw-r--r-- | addons/auth_oauth/controllers/main.py | 3 | ||||
| -rw-r--r-- | addons/auth_signup/controllers/main.py | 3 |
2 files changed, 6 insertions, 0 deletions
diff --git a/addons/auth_oauth/controllers/main.py b/addons/auth_oauth/controllers/main.py index 53a6ffd5462..a338927c3a1 100644 --- a/addons/auth_oauth/controllers/main.py +++ b/addons/auth_oauth/controllers/main.py @@ -68,6 +68,9 @@ class OAuthLogin(openerp.addons.web.controllers.main.Home): @http.route() def web_login(self, *args, **kw): + if request.httprequest.method == 'GET' and request.session.uid and request.params.get('redirect'): + # Redirect if already logged in and redirect param is present + return http.redirect_with_hash(request.params.get('redirect')) providers = self.list_providers() response = super(OAuthLogin, self).web_login(*args, **kw) diff --git a/addons/auth_signup/controllers/main.py b/addons/auth_signup/controllers/main.py index 08b67108c3f..92ae6364954 100644 --- a/addons/auth_signup/controllers/main.py +++ b/addons/auth_signup/controllers/main.py @@ -37,6 +37,9 @@ class AuthSignup(openerp.addons.web.controllers.main.Home): mode = request.params.get('mode') qcontext = request.params.copy() super_response = None + if request.httprequest.method == 'GET' and request.session.uid and request.params.get('redirect'): + # Redirect if already logged in and redirect param is present + return http.redirect_with_hash(request.params.get('redirect')) if request.httprequest.method != 'POST' or mode not in ('reset', 'signup'): # Default behavior is to try to login, which in reset or signup mode in a non-sense. super_response = super(AuthSignup, self).web_login(*args, **kw) |
