From: Eric Biagiotti Date: Wed, 8 May 2019 19:36:59 +0000 (-0400) Subject: 15088: Adds logout before logging in to second account X-Git-Tag: 1.4.0~1^2~20 X-Git-Url: https://git.arvados.org/arvados-workbench2.git/commitdiff_plain/ad1b12ef73a2981ed40f3dbdb8d6e1cc9d35a2cd 15088: Adds logout before logging in to second account Arvados-DCO-1.1-Signed-off-by: Eric Biagiotti --- diff --git a/src/store/link-account-panel/link-account-panel-actions.ts b/src/store/link-account-panel/link-account-panel-actions.ts index 5e7a02b4..54657377 100644 --- a/src/store/link-account-panel/link-account-panel-actions.ts +++ b/src/store/link-account-panel/link-account-panel-actions.ts @@ -14,6 +14,7 @@ import { UserResource } from "~/models/user"; import { GroupResource } from "~/models/group"; import { LinkAccountPanelError, OriginatingUser } from "./link-account-panel-reducer"; import { navigateToRootProject } from "../navigation/navigation-action"; +import { login, logout } from "~/store/auth/auth-action"; export const linkAccountPanelActions = unionize({ LINK_INIT: ofType<{ targetUser: UserResource | undefined }>(), @@ -151,7 +152,8 @@ export const saveAccountLinkData = (t: LinkAccountType) => const accountToLink = {type: t, userUuid: services.authService.getUuid(), token: services.authService.getApiToken()} as AccountToLink; services.linkAccountService.saveToSession(accountToLink); const auth = getState().auth; - services.authService.login(auth.localCluster, auth.remoteHosts[auth.homeCluster]); + dispatch(logout()); + dispatch(login(auth.localCluster, auth.remoteHosts[auth.homeCluster])); }; export const getAccountLinkData = () =>