Basic editing with some widgets

This commit is contained in:
Mathias Biilmann Christensen
2016-05-30 16:55:32 -07:00
parent 978b7290c5
commit d2aa1adf7b
23 changed files with 307 additions and 32 deletions

View File

@ -33,6 +33,6 @@ export function loginUser(credentials) {
dispatch(authenticating());
backend.authenticate(credentials)
.then((user) => dispatch(authenticate(user)))
.catch((err) => dispatch(authError(err)));
//.catch((err) => dispatch(authError(err)));
};
}

View File

@ -1,4 +1,6 @@
import yaml from 'js-yaml';
import { currentBackend } from '../backends/backend';
import { authenticate } from '../actions/auth';
export const CONFIG_REQUEST = 'CONFIG_REQUEST';
export const CONFIG_SUCCESS = 'CONFIG_SUCCESS';
@ -37,7 +39,12 @@ export function loadConfig(config) {
throw `Failed to load config.yml (${response.status})`;
}
response.text().then(parseConfig).then((config) => dispatch(configLoaded(config)));
response.text().then(parseConfig).then((config) => {
dispatch(configLoaded(config));
const backend = currentBackend(config);
const user = backend && backend.currentUser();
user && dispatch(authenticate(user));
});
}).catch((err) => {
dispatch(configFailed(err));
});