From b2591828fefb15c14768816995ab6301ef13e062 Mon Sep 17 00:00:00 2001 From: Jared Scheib Date: Tue, 12 Dec 2017 15:10:54 -0800 Subject: [PATCH] Pass through config link to redux --- ui/src/shared/actions/auth.js | 5 ++++- ui/src/utils/ajax.js | 11 ++++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/ui/src/shared/actions/auth.js b/ui/src/shared/actions/auth.js index cf32026525..295d66ef53 100644 --- a/ui/src/shared/actions/auth.js +++ b/ui/src/shared/actions/auth.js @@ -64,6 +64,7 @@ export const getMeAsync = ({shouldResetMe = false} = {}) => async dispatch => { users, organizations, meLink, + config, } = await getMeAJAX() dispatch( meGetCompleted({ @@ -72,7 +73,9 @@ export const getMeAsync = ({shouldResetMe = false} = {}) => async dispatch => { logoutLink, }) ) - dispatch(linksReceived({external, users, organizations, me: meLink})) // TODO: put this before meGetCompleted... though for some reason it doesn't fire the first time then + dispatch( + linksReceived({external, users, organizations, me: meLink, config}) + ) // TODO: put this before meGetCompleted... though for some reason it doesn't fire the first time then } catch (error) { dispatch(meGetFailed()) dispatch(errorThrown(error)) diff --git a/ui/src/utils/ajax.js b/ui/src/utils/ajax.js index 69ee8bf04d..232fa81255 100644 --- a/ui/src/utils/ajax.js +++ b/ui/src/utils/ajax.js @@ -10,7 +10,15 @@ const addBasepath = (url, excludeBasepath) => { } const generateResponseWithLinks = (response, newLinks) => { - const {auth, logout, external, users, organizations, me: meLink} = newLinks + const { + auth, + logout, + external, + users, + organizations, + me: meLink, + config, + } = newLinks return { ...response, auth: {links: auth}, @@ -19,6 +27,7 @@ const generateResponseWithLinks = (response, newLinks) => { users, organizations, meLink, + config, } }