Skip to content

Commit

Permalink
#3704 logout in war file context
Browse files Browse the repository at this point in the history
  • Loading branch information
billreed63 committed Jan 25, 2013
1 parent 3aedbfd commit f0af69a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
9 changes: 7 additions & 2 deletions maqetta.core.client/WebContent/davinci/Workbench.js
Expand Up @@ -136,11 +136,16 @@ var handleIoError = function (deferred, reason) {
};

var sessionTimedOut = function(){
var loginHref = '/maqetta/welcome';
/* var loginHref = '/maqetta/welcome';
if(Runtime.singleUserMode()) {
loginHref = '/maqetta/';
}*/
var newLocation = Workbench.location();
var lastChar = newLocation.length - 1;
if (newLocation.charAt(lastChar) == '/') {
newLocation = newLocation.substr(0,lastChar);

This comment has been minimized.

Copy link
@peller

peller Jan 27, 2013

Member

why not just use a relative url of 'welcome' and skip the string parsing?

}

var loginHref = newLocation + "/welcome";
var dialog = new Dialog({
title: webContent.sessionTimedOut
//, style: "width: 300px"
Expand Down
Expand Up @@ -9,10 +9,10 @@ return declare("davinci.actions.LogoutAction", Action, {
run: function() {

/* call the logout URL then redirect to maqetta login page */

var logoutRequest = new XMLHttpRequest();
logoutRequest.onreadystatechange = function() {
location.href = "/maqetta/";
location.href = location.href; // "/maqetta/"; wrong place in war war or if context changes #3704
};
var parameters = "";
logoutRequest.open("POST", "../logout", false);
Expand Down

0 comments on commit f0af69a

Please sign in to comment.