From dec81d42222814723ff0386665928045ff41eac8 Mon Sep 17 00:00:00 2001 From: Peter Amstutz Date: Tue, 5 Nov 2019 16:12:09 -0500 Subject: [PATCH] 15736: Make sure to save sessions from state not local --- src/store/auth/auth-action-session.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/store/auth/auth-action-session.ts b/src/store/auth/auth-action-session.ts index 1c9d1d1411..5b8acf9aeb 100644 --- a/src/store/auth/auth-action-session.ts +++ b/src/store/auth/auth-action-session.ts @@ -203,7 +203,7 @@ export const validateSessions = () => } } } - services.authService.saveSessions(sessions); + services.authService.saveSessions(getState().auth.sessions); dispatch(progressIndicatorActions.STOP_WORKING("sessionsValidation")); } }; @@ -246,9 +246,9 @@ export const addSession = (remoteHost: string, token?: string, sendToLogin?: boo }; if (sessions.find(s => s.clusterId === config.uuidPrefix)) { - dispatch(authActions.UPDATE_SESSION(session)); + await dispatch(authActions.UPDATE_SESSION(session)); } else { - dispatch(authActions.ADD_SESSION(session)); + await dispatch(authActions.ADD_SESSION(session)); } services.authService.saveSessions(getState().auth.sessions); @@ -302,7 +302,6 @@ export const toggleSession = (session: Session) => export const initSessions = (authService: AuthService, config: Config, user: User) => (dispatch: Dispatch) => { const sessions = authService.buildSessions(config, user); - authService.saveSessions(sessions); dispatch(authActions.SET_SESSIONS(sessions)); dispatch(validateSessions()); }; -- 2.30.2