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
This commit is contained in:
Nicolas Vazquez 2022-04-06 06:03:30 -03:00 committed by GitHub
parent ca8782b703
commit 4193109c1d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -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)