Skip to content

Commit

Permalink
Item13069: make login and out work
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelDaum committed Feb 16, 2015
1 parent 40f7cf5 commit b51f98d
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
11 changes: 10 additions & 1 deletion pub/System/AngularSkin/controller.uncompressed.js
Expand Up @@ -75,6 +75,15 @@ app.controller("ViewCtrl", [
$location.url("/"+web+"/"+topic);
}

// switch off angular mode
if (search.logout) {
url = foswiki.getScriptUrl("view", web, topic, { logout: 1});
$log.debug("logging out redirecting to ",url);
window.location.href = url;
return false;
}

// log out
if (typeof(angularMode) !== 'undefined' && angularMode === "0") {
// reload page
url = foswiki.getScriptUrl("view", web, topic, { angular_mode: 0});
Expand Down Expand Up @@ -124,7 +133,7 @@ app.controller("ViewCtrl", [
$log.error(msg);

if (data.error.code === 401 && $scope.script !== 'login') {
$location.path("/login/"+$scope.web+"/"+$scope.topic).replace();
window.location.href = foswiki.getScriptUrl("login", $scope.web, $scope.topic);
}
} else {
$log.debug("aborded previous request");
Expand Down
11 changes: 10 additions & 1 deletion pub/System/AngularSkin/pkg.uncompressed.js
Expand Up @@ -283,6 +283,15 @@ app.controller("ViewCtrl", [
$location.url("/"+web+"/"+topic);
}

// switch off angular mode
if (search.logout) {
url = foswiki.getScriptUrl("view", web, topic, { logout: 1});
$log.debug("logging out redirecting to ",url);
window.location.href = url;
return false;
}

// log out
if (typeof(angularMode) !== 'undefined' && angularMode === "0") {
// reload page
url = foswiki.getScriptUrl("view", web, topic, { angular_mode: 0});
Expand Down Expand Up @@ -332,7 +341,7 @@ app.controller("ViewCtrl", [
$log.error(msg);

if (data.error.code === 401 && $scope.script !== 'login') {
$location.path("/login/"+$scope.web+"/"+$scope.topic).replace();
window.location.href = foswiki.getScriptUrl("login", $scope.web, $scope.topic);
}
} else {
$log.debug("aborded previous request");
Expand Down

0 comments on commit b51f98d

Please sign in to comment.