This is to make the "Get API token" dialog default to the wb2's session token.
Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <lucas@di-pentima.com.ar>
LOGOUT: ofType<{ deleteLinkData: boolean }>(),
SET_CONFIG: ofType<{ config: Config }>(),
SET_EXTRA_TOKEN: ofType<{ extraApiToken: string, extraApiTokenExpiration?: Date }>(),
LOGOUT: ofType<{ deleteLinkData: boolean }>(),
SET_CONFIG: ofType<{ config: Config }>(),
SET_EXTRA_TOKEN: ofType<{ extraApiToken: string, extraApiTokenExpiration?: Date }>(),
INIT_USER: ofType<{ user: User, token: string, tokenExpiration?: Date }>(),
USER_DETAILS_REQUEST: {},
USER_DETAILS_SUCCESS: ofType<User>(),
INIT_USER: ofType<{ user: User, token: string, tokenExpiration?: Date }>(),
USER_DETAILS_REQUEST: {},
USER_DETAILS_SUCCESS: ofType<User>(),
extraApiTokenExpiration: client.expiresAt ? new Date(client.expiresAt): undefined,
}));
return extraToken;
extraApiTokenExpiration: client.expiresAt ? new Date(client.expiresAt): undefined,
}));
return extraToken;
+ } catch (e) {
+ dispatch(authActions.RESET_EXTRA_TOKEN());
+ }
}
const user = getState().auth.user;
const loginCluster = getState().auth.config.clusterConfig.Login.LoginCluster;
}
const user = getState().auth.user;
const loginCluster = getState().auth.config.clusterConfig.Login.LoginCluster;
}),
SET_EXTRA_TOKEN: ({ extraApiToken, extraApiTokenExpiration }) =>
({ ...state, extraApiToken, extraApiTokenExpiration }),
}),
SET_EXTRA_TOKEN: ({ extraApiToken, extraApiTokenExpiration }) =>
({ ...state, extraApiToken, extraApiTokenExpiration }),
+ RESET_EXTRA_TOKEN: () =>
+ ({ ...state, extraApiToken: undefined, extraApiTokenExpiration: undefined }),
INIT_USER: ({ user, token, tokenExpiration }) =>
({ ...state,
user,
INIT_USER: ({ user, token, tokenExpiration }) =>
({ ...state,
user,