[FIX] auth_oauth: avoid infinite loop while trying to sign in

bzr revid: dle@openerp.com-20140407155919-vm32q6nvcit59026
This commit is contained in:
Denis Ledoux 2014-04-07 17:59:19 +02:00
parent 6027657e3e
commit ff76882701
1 changed files with 3 additions and 1 deletions

View File

@ -2,6 +2,7 @@ import functools
import logging
import simplejson
import urlparse
import werkzeug.utils
from werkzeug.exceptions import BadRequest
@ -117,7 +118,8 @@ class OAuthController(http.Controller):
menu = state.get('m')
redirect = state.get('r')
url = '/web'
if redirect:
if redirect and not redirect.startswith('/auth_oauth/signin') and \
(not redirect.startswith('/web/login') or 'redirect' in urlparse.urlsplit(redirect).query):
url = redirect
elif action:
url = '/web#action=%s' % action