Skip to content

Commit

Permalink
fixed redirect page to enrolled course
Browse files Browse the repository at this point in the history
  • Loading branch information
ksripathi committed Jan 4, 2018
1 parent f616d55 commit 1e0c43a
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/runtime/authentication.org
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ var setLoginUrlInContentIframe = function(event) {
document.cookie = "session-status='logged-out'";
iframe.src = hosted_base + "/logout";
toggleBtns();
loadAllDisciplines();
setTimeout(loadAllDisciplines, 600);
}
};

Expand Down Expand Up @@ -168,16 +168,20 @@ function processPostMessage(evt) {
toggleBackButtonFlag(loadAllDisciplines);
}
};

var post_msg = evt.data.toLocaleLowerCase();
var post_msg_dict = JSON.parse(evt.data);
var post_msg = post_msg_dict.message.toLocaleLowerCase();
var referrer = post_msg_dict.referrer;
var iframe = document.getElementById("contentIframe");

if (post_msg.indexOf("my courses") != -1) {
document.cookie = "session-status='logged-in'";
if (window.lab_url == "") {
if (window.loggedInState == true) {
iframe.src = referrer;
}
else if (window.lab_url == "") {
loadAllDisciplines();
}
else {
var iframe = document.getElementById("contentIframe");
iframe.src = window.lab_url;
}
} else {
Expand Down

0 comments on commit 1e0c43a

Please sign in to comment.