Accepted answer

dispatch(login(formData)) returns undefined

Based on the docs for redux-thunk:

Any return value from the inner function will be available as the return value of dispatch itself.

So, you'd want something like

// thunk action creator returns a function
export function login(credentials) {
    return dispatch => {
        // update app state: requesting login

        // try to log in
            .then(authToken => dispatch(loginSuccess(authToken)))
            .catch(error => dispatch(loginFailure(error)))

        return promiseOfSomeSort;

Related Query

More Query from same tag