Код: Выделить всё
onSubmitOtp = () => {
console.log(this.state.mobile);
console.log(JSON.stringify(this.state.otp));
fetch('https://cors-anywhere.herokuapp.com/http://35.154.16.105:8080/signup/validateOtp',{
method:'post',
headers:{'Content-Type':'application/json'},
body: JSON.stringify({
mobile: this.state.mobile,
otp:this.state.otp
})
})
.then(response => response.json())
.then(data =>{
if(data.content === 'OK'){
// this.props.loadNewUser(this.state.otp);
console.log(this.state.mobile);
this.props.onRouteChange('createprofile','nonav');
}
else
console.log(data.error);
})
this.props.onRouteChange('otp','nonav');
}

Error-
Otp.js:19 POST https://cors-alhywhere.herokuapp.com/ht ... alidateotp 500 (ошибка внутреннего сервера)
Подробнее здесь: https://stackoverflow.com/questions/638 ... ng-the-api