Commit f77c06ff by Anurag Ramdasan

check if next is not defined

parent c4fa475c
......@@ -51,7 +51,11 @@
$('#login-form').on('ajax:success', function(event, json, xhr) {
if(json.success) {
var u=decodeURI(window.location.search);
var next=decodeURIComponent(u.split("next=")[1]);
var next = u.split("next=")[1];
if (next != undefined) {
// if next is undefined, decodeURI returns "undefined" causing a bad redirect.
next = decodeURI(next);
}
if (next && !isExternal(next)) {
location.href=next;
} else if(json.redirect_url){
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment