Skip to content

Commit ed2e1a1

Browse files
the-mikedavismergify[bot]
authored andcommitted
Clear management auth storage when redirecting to login
This branch redirects the client to the login page when the cookie expires. To complete the logout process we should also clear any auth data stored in local storage: local storage has no built-in expiration mechanism. To test this locally you can use `make run-broker`, set the session timeout to one minute for quick testing: application:set_env(rabbitmq_management, login_session_timeout, 1) go to the management page (`http://localhost:15672/#/`), login with default credentials and wait a minute. After this change the local storage only contains info like `rabbitmq.vhost` and `rabbitmq.version`. (cherry picked from commit 2a1b65d)
1 parent 938a2f5 commit ed2e1a1

File tree

1 file changed

+2
-1
lines changed
  • deps/rabbitmq_management/priv/www/js

1 file changed

+2
-1
lines changed

deps/rabbitmq_management/priv/www/js/main.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1316,7 +1316,8 @@ function update_status(status) {
13161316

13171317
function with_req(method, path, body, fun) {
13181318
if(!has_auth_credentials()) {
1319-
// navigate to the login form
1319+
// Clear any lingering auth settings in local storage and navigate to the login form.
1320+
clear_auth();
13201321
location.reload();
13211322
return;
13221323
}

0 commit comments

Comments
 (0)