Witam, potrzebuje zaimplementować social authentication (przy użyciu github, fb, google+). Jeśli po stronie klienta używam bezpośredniego linku:
<a href='/auth/github'><SocialButtonLogin name="github"/></a>
to wszystko działa jak należy. Natomiast jeśli używam akcji redux:
<SocialButtonLogin onClick={() => this.props.socialAuth('github')} name="github"/>
export function socialAuth(type) {
return dispatch => {
return axios.get(`/auth/${type}`)
.then(res => {
dispatch(saveUser(res.data.user));
return res;
})
.catch(err => {
console.log('catch', err.response);
throw err.response;
});
}
}
to wtedy wyrzuca CORS error. Po przeszukaniu internetów widzę, że nie tylko ja mam z tym problem - https://github.com/erikras/react-redux-universal-hot-example/issues/155#issuecomment-204086618, niestety nigdzie nie mogę znaleźć jego rozwiązania..