Skip to content

Commit

Permalink
Merge pull request #11231 from rabbitmq/mergify/bp/v3.13.x/pr-11226
Browse files Browse the repository at this point in the history
Fix a management UI issue with a page refresh after logging out (backport #11226)
  • Loading branch information
michaelklishin authored May 14, 2024
2 parents 76c7910 + 4bf66ab commit cd079d9
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
1 change: 0 additions & 1 deletion deps/rabbitmq_management/priv/www/js/dispatcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,6 @@ dispatcher_add(function(sammy) {
oauth_initiateLogout();
}else {
go_to_home()
// location.reload();
}
});

Expand Down
3 changes: 3 additions & 0 deletions deps/rabbitmq_management/priv/www/js/oidc-oauth/helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,9 @@ function oauth_redirectToHome(oauth) {
function go_to(path) {
location.href = rabbit_path_prefix() + "/" + path
}
function go_to_home() {
location.href = rabbit_path_prefix() + "/"
}
function go_to_authority() {
location.href = oauth.authority
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ describe('When a logged in user', function () {
it('logs out', async function () {
await loginPage.login('guest', 'guest')
await overview.isLoaded()
await overview.selectRefreshOption("Do not refresh")
await overview.logout()
await loginPage.isLoaded()
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const MENU_TABS = By.css('div#menu ul#tabs')
const USER = By.css('li#logout')
const LOGOUT_FORM = By.css('li#logout form')
const SELECT_VHOSTS = By.css('select#show-vhost')

const SELECT_REFRESH = By.css('ul#topnav li#interval select#update-every')
const OVERVIEW_TAB = By.css('div#menu ul#tabs li#overview')
const CONNECTIONS_TAB = By.css('div#menu ul#tabs li#connections')
const CHANNELS_TAB = By.css('div#menu ul#tabs li#channels')
Expand Down Expand Up @@ -36,7 +36,9 @@ module.exports = class BasePage {
async getUser () {
return this.getText(USER)
}

async selectRefreshOption(option) {
return this.selectOption(SELECT_REFRESH, option)
}
async waitForOverviewTab() {
return this.waitForDisplayed(OVERVIEW_TAB)
}
Expand Down

0 comments on commit cd079d9

Please sign in to comment.