Skip to content

Commit

Permalink
[Backport 4.3-7.16] change function to get the path programatically (#…
Browse files Browse the repository at this point in the history
…4820)

change function to get the path programatically (#4815)

* change function to get the path programatically

* update changelog

(cherry picked from commit 72ba21a)

Co-authored-by: Nico Guevara <[email protected]>
  • Loading branch information
github-actions[bot] and Tostti authored Nov 8, 2022
1 parent 7926004 commit 4775f8b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ All notable changes to the Wazuh app project will be documented in this file.
- Fixed persistence of the plugin registry file between updates [#4359](https:/wazuh/wazuh-kibana-app/pull/4359)
- Fixed searchbar error on SCA Inventory table [#4367](https:/wazuh/wazuh-kibana-app/pull/4367)
- Fixed a routes loop when reinstalling Wazuh indexer [#4373](https:/wazuh/wazuh-kibana-app/pull/4373)
- Fixed issue when logging out from Wazuh when SAML is enabled [#4815](https:/wazuh/wazuh-kibana-app/issues/4815)

# Removed

Expand Down
7 changes: 2 additions & 5 deletions public/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,6 @@ app.run(['$rootElement', function ($rootElement) {
// Add plugin help links as extension to plugin platform help menu
addHelpMenuToAppChrome();


const urlToLogout = getHttp().basePath.prepend('/logout');

// Bind deleteExistentToken on Log out component.
$('.euiHeaderSectionItem__button, .euiHeaderSectionItemButton').on('mouseleave', function () {
// opendistro
Expand All @@ -119,14 +116,14 @@ app.run(['$rootElement', function ($rootElement) {
// x-pack
$('a:contains(Log out)').on('click', function (event) {
// Override href's behaviour and navigate programatically
// to '/logout' once the token has been deleted.
// to the logout path once the token has been deleted.
event.preventDefault();
WzAuthentication.deleteExistentToken()
.catch((err) => {
console.error('[ERROR] - User token could not be deprecated - ', err);
})
.finally(() => {
window.location = urlToLogout;
window.location = event.currentTarget.href;
});
});
});
Expand Down

0 comments on commit 4775f8b

Please sign in to comment.