If user was trying to get to a specific page but had to log in, let them

get to that page once they've logged in.
This commit is contained in:
Don Mitchell
2013-02-13 11:20:08 -05:00
parent 3450c72833
commit 4e3e2ec707

View File

@@ -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('<div id="login_error" class="message message-status error">' + json.value + '</span></div>');
$('#login_error').addClass('is-shown');