diff --git a/src/actions/SlackAuthAction.js b/src/actions/SlackAuthAction.js
index a01b762a2..1f6df76d0 100644
--- a/src/actions/SlackAuthAction.js
+++ b/src/actions/SlackAuthAction.js
@@ -3,15 +3,12 @@ import { replace } from 'react-router-redux';
import { client } from 'utils/ApiClient';
import auth from 'utils/auth';
-import { updateUser } from './UserActions';
-import { updateTeam } from './TeamActions';
-
export const SLACK_AUTH_PENDING = 'SLACK_AUTH_PENDING';
export const SLACK_AUTH_SUCCESS = 'SLACK_AUTH_SUCCESS';
export const SLACK_AUTH_FAILURE = 'SLACK_AUTH_FAILURE';
const slackAuthPending = makeActionCreator(SLACK_AUTH_PENDING);
-const slackAuthSuccess = makeActionCreator(SLACK_AUTH_SUCCESS, 'user');
+const slackAuthSuccess = makeActionCreator(SLACK_AUTH_SUCCESS, 'user', 'team');
const slackAuthFailure = makeActionCreator(SLACK_AUTH_FAILURE, 'error');
export function slackAuthAsync(code) {
@@ -23,12 +20,11 @@ export function slackAuthAsync(code) {
})
.then(data => {
auth.setToken(data.data.accessToken);
- dispatch(updateUser(data.data.user));
- dispatch(updateTeam(data.data.team));
+ dispatch(slackAuthSuccess(data.data.user, data.data.team));
dispatch(replace('/dashboard'));
})
- // .catch((err) => {
- // dispatch(push('/error'));
- // })
+ .catch((err) => {
+ dispatch(push('/error'));
+ })
};
};
\ No newline at end of file
diff --git a/src/index.js b/src/index.js
index 851e6dfa4..b050ea539 100644
--- a/src/index.js
+++ b/src/index.js
@@ -35,7 +35,32 @@ const store = createStore(reducer, applyMiddleware(
routerMiddlewareWithHistory,
loggerMiddleware,
), autoRehydrate());
-persistStore(store);
+
+persistStore(store, {
+ whitelist: [
+ 'user',
+ 'team',
+ ]
+}, () => {
+ render((
+