X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/f9dde5c781766b8be71d43d0f031c201a0edcfbb..f71049ee5bf2560fbbca09c1f141e176e1a7eb06:/src/store/auth/auth-action.ts diff --git a/src/store/auth/auth-action.ts b/src/store/auth/auth-action.ts index ed998ab5..6c54a5c9 100644 --- a/src/store/auth/auth-action.ts +++ b/src/store/auth/auth-action.ts @@ -11,6 +11,7 @@ import { SshKeyResource } from '~/models/ssh-key'; import { User } from "~/models/user"; import { Session } from "~/models/session"; import { Config } from '~/common/config'; +import { initSessions } from "~/store/auth/auth-action-session"; export const authActions = unionize({ SAVE_API_TOKEN: ofType(), @@ -49,10 +50,8 @@ export const initAuth = (config: Config) => (dispatch: Dispatch, getState: () => } if (token && user) { dispatch(authActions.INIT({ user, token })); + dispatch(initSessions(services.authService, config, user)); } - const sessions = services.authService.buildSessions(config, user); - services.authService.saveSessions(sessions); - dispatch(authActions.SET_SESSIONS(sessions)); }; export const saveApiToken = (token: string) => (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => {