This is an automated email from the ASF dual-hosted git repository.
rohit pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/cloudstack.git
The following commit(s) were added to refs/heads/main by this push:
new 4193109c1d ui: Logout before login (#6193)
4193109c1d is described below
commit 4193109c1d1e6a5f76f5aa359a6d249cc60804dc
Author: Nicolas Vazquez <[email protected]>
AuthorDate: Wed Apr 6 06:03:30 2022 -0300
ui: Logout before login (#6193)
This PR calls the logout API before login, to cleanup any duplicate
sessionkey, as it was done on the legacy UI: #4326
Fixes: #6127
---
ui/src/api/index.js | 3 +++
1 file changed, 3 insertions(+)
diff --git a/ui/src/api/index.js b/ui/src/api/index.js
index 7cb2edef98..e54a71552e 100644
--- a/ui/src/api/index.js
+++ b/ui/src/api/index.js
@@ -43,6 +43,9 @@ export function api (command, args = {}, method = 'GET', data
= {}) {
export function login (arg) {
sourceToken.init()
+ // Logout before login is called to purge any duplicate sessionkey cookies
+ api('logout')
+
const params = new URLSearchParams()
params.append('command', 'login')
params.append('username', arg.username || arg.email)