|
@@ -8,7 +8,7 @@ from django.views.decorators.cache import never_cache
|
|
from django.views.decorators.csrf import csrf_protect
|
|
from django.views.decorators.csrf import csrf_protect
|
|
from django.views.decorators.debug import sensitive_post_parameters
|
|
from django.views.decorators.debug import sensitive_post_parameters
|
|
|
|
|
|
-from misago.core.embercli import is_ember_cli_request
|
|
|
|
|
|
+from misago.core.embercli import is_ember_cli_request, get_embercli_host
|
|
|
|
|
|
|
|
|
|
@sensitive_post_parameters()
|
|
@sensitive_post_parameters()
|
|
@@ -22,14 +22,13 @@ def login(request):
|
|
url=redirect_to, host=request.get_host())
|
|
url=redirect_to, host=request.get_host())
|
|
|
|
|
|
if not is_redirect_safe and is_ember_cli_request(request):
|
|
if not is_redirect_safe and is_ember_cli_request(request):
|
|
- parsed_url = urlparse(settings.MISAGO_EMBER_CLI_ORIGIN)
|
|
|
|
- trusted_host = '%s:%s' % (parsed_url.hostname, parsed_url.port)
|
|
|
|
is_redirect_safe = is_safe_url(
|
|
is_redirect_safe = is_safe_url(
|
|
- url=redirect_to, host=trusted_host)
|
|
|
|
|
|
+ url=redirect_to, host=get_embercli_host())
|
|
|
|
|
|
if is_redirect_safe:
|
|
if is_redirect_safe:
|
|
redirect_to_path = urlparse(redirect_to).path
|
|
redirect_to_path = urlparse(redirect_to).path
|
|
return redirect(redirect_to_path)
|
|
return redirect(redirect_to_path)
|
|
|
|
+
|
|
return redirect(settings.LOGIN_REDIRECT_URL)
|
|
return redirect(settings.LOGIN_REDIRECT_URL)
|
|
|
|
|
|
|
|
|