Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix logout from Wazuh when SAML is enabled (4.4) #4664

Merged
merged 2 commits into from
Oct 17, 2022
Merged
Show file tree
Hide file tree
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
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.
- Fixed nested field rendering in security alerts table details [#4428](https:/wazuh/wazuh-kibana-app/pull/4428)
- 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 @@ -111,8 +111,6 @@ app.run(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 @@ -123,14 +121,14 @@ app.run(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