Skip to content

Commit

Permalink
Fix logout from Wazuh when SAML is enabled (#4664)
Browse files Browse the repository at this point in the history
* change function to get the path programatically

* Update changelog

(cherry picked from commit c320b31)
  • Loading branch information
Tostti authored and github-actions[bot] committed Oct 17, 2022
1 parent 4eebd9a commit b61f9fe
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ All notable changes to the Wazuh app project will be documented in this file.
- Improved Agents Overview performance [#4363](https:/wazuh/wazuh-kibana-app/pull/4363)
- Fixed a bug where the Wazuh logo was used instead of the custom one [#4539](https:/wazuh/wazuh-kibana-app/pull/4539)
- Fixed rendering problems of the `Agent Overview` section in low resolutions [#4516](https:/wazuh/wazuh-kibana-app/pull/4516)
- Fixed issue when logging out from Wazuh when SAML is enabled [#4595](https:/wazuh/wazuh-kibana-app/issues/4595)

## Wazuh v4.3.8 - Kibana 7.10.2, 7.16.x, 7.17.x - Revision 4309

Expand Down
6 changes: 2 additions & 4 deletions public/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +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 () {
Expand All @@ -119,14 +117,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 b61f9fe

Please sign in to comment.