summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEd Tanous <edtanous@google.com>2023-03-27 23:19:31 +0300
committerKiran Kumar Ballapalli <kirankumarb@ami.com>2023-04-05 21:03:10 +0300
commit80d697d8a6e9343aeba1a4955fdbbc4627bf2e9e (patch)
tree6a16fac8c11a4e4dad1981b40ba1c98eca806c46 /src
parentbcb0ab4f1e933795e53da7c28ca75382c94f9af9 (diff)
downloadwebui-vue-80d697d8a6e9343aeba1a4955fdbbc4627bf2e9e.tar.xz
Fix popup-box authenticate on session disconnect
On the session Web UI page, when we disconnect the current session, instead of navigating to the login page, the browser populates the authentication window for basic authorization. If basic authentication is enabled, we are adding the www-authenticate header to unauthorizing requests. As per redfish, we have to set the "Accept" and "X-Requested-With" header for the request from Web UI. This patch set will add those headers. Tested: Logged in to the WebUI and navigated to the sessions page. Clicked "Disconnect" to the current session and the WebUI is navigated to login. page as expected. Change-Id: I61cccbf41e854683e6cd5aa80fa72593ae4aa698 Signed-off-by: Ed Tanous <edtanous@google.com>
Diffstat (limited to 'src')
-rw-r--r--src/store/api.js3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/store/api.js b/src/store/api.js
index 02472881..51c5cdc4 100644
--- a/src/store/api.js
+++ b/src/store/api.js
@@ -4,6 +4,9 @@ import Axios from 'axios';
//dotenv customizations.
import store from '../store';
+Axios.defaults.headers.common['Accept'] = 'application/json';
+Axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest';
+
const api = Axios.create({
withCredentials: true,
});