From 4e3e2ec707ff409ec8a2fb4a332cfc19a744a28e Mon Sep 17 00:00:00 2001 From: Don Mitchell Date: Wed, 13 Feb 2013 11:20:08 -0500 Subject: [PATCH] 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. --- cms/templates/login.html | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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');