I want to create authentication system.I made a form on submitting i send user credentials and receive a token in return using ajax response. Now I want to redirect to home page after token is received.
I am using react router 4,redux-thunk middleware I tried to do this with context but it did not worked.
onSubmit(e){
e.preventDefault();
this.setState({isLoading:true});
this.props.login(this.state).then(function(response){
console.log('token', response.data.token);
//Redirect to home component
});
}