diff --git a/cms/templates/login.html b/cms/templates/login.html index 7a32b735cb..94fd0f4d95 100644 --- a/cms/templates/login.html +++ b/cms/templates/login.html @@ -77,7 +77,11 @@ submit_data, function(json) { if(json.success) { - location.href = "${reverse('homepage')}"; + var next = /next=([^&]*)/g.exec(decodeURIComponent(window.location.search)); + if (next.length > 1) { + location.href = next[1]; + } + else location.href = "${reverse('homepage')}"; } else if($('#login_error').length == 0) { $('#login_form').prepend('
' + json.value + '
'); $('#login_error').addClass('is-shown');