ı want to make auth in ionic 3 with laravel api.
when ı click sigup button my signup info is inserted database very vell. but it doesnt go another page , just inserted to database. And ı face this error .
Cross-Origin Read Blocking (CORB) blocked cross-origin response http://localhost/api/studentpost with MIME type application/json. See https://www.chromestatus.com/feature/5629709824032768 for more details.
signup.ts
export class SignUpPage {
responseData : any;
userData = {"full_name":"", "password":"","email":"","name":""};
signup(){
this.authProvider.postData(this.userData,'signup').then((result) => {
this.responseData = result;
if(this.responseData.userData){
console.log(this.responseData);
localStorage.setItem('userData', JSON.stringify(this.responseData));
this.navCtrl.push(HomePage);
}
else{ console.log("User already exists"); }
}, (err) => {
// Error log
});
}
service provider
postData(credentials, type){
return new Promise((resolve, reject) =>{
let headers = new Headers({
'Content-Type' : 'application/json'
});
let options = new RequestOptions({ headers: headers });
this.http.post(apiUrl, JSON.stringify(credentials), {headers: headers}).
subscribe(res =>{
resolve(res.json());
}, (err) =>{
reject(err);
});
});
}