Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 26 additions & 18 deletions zeppelin-web/src/components/navbar/navbar.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ angular.module('zeppelinWebApp')
return notebook;
}

if (notebook.children) {
if (notebook.children) {
filteringNote(notebook.children, filteredNotes);
}
});
Expand Down Expand Up @@ -108,23 +108,31 @@ angular.module('zeppelinWebApp')
});

$scope.logout = function() {
$http.post(baseUrlSrv.getRestApiBase()+'/login/logout')
.success(function(data, status, headers, config) {
$rootScope.userName = '';
$rootScope.ticket.principal = '';
$rootScope.ticket.ticket = '';
$rootScope.ticket.roles = '';
BootstrapDialog.show({
message: 'Logout Success'
});
setTimeout(function() {
window.location = '#';
window.location.reload();
}, 1000);
}).
error(function(data, status, headers, config) {
console.log('Error %o %o', status, data.message);
});
var logoutURL = baseUrlSrv.getRestApiBase() + '/login/logout';
var request = new XMLHttpRequest();

//force authcBasic (if configured) to logout by setting credentials as false:false
request.open('post', logoutURL, true, 'false', 'false');
request.onreadystatechange = function() {
if (request.readyState === 4) {
if (request.status === 401 || request.status === 405) {
$rootScope.userName = '';
$rootScope.ticket.principal = '';
$rootScope.ticket.ticket = '';
$rootScope.ticket.roles = '';
BootstrapDialog.show({
message: 'Logout Success'
});
setTimeout(function() {
window.location.replace('/');
}, 1000);
} else {
request.open('post', logoutURL, true, 'false', 'false');
request.send();
}
}
};
request.send();
};

$scope.search = function(searchTerm) {
Expand Down