Issue
How do I use this code to make the login work? When the login button is click, it didn't login at all. Not sure what is the error as it's not shown.
login() {
var url = 'https://login.app/login';
var postData = JSON.stringify({
// saving it as Email and will be used at server.js
Email: this.loginForm.value['email'],
Password: this.loginForm.value['password'],
});
const httpOptions = {
headers: new HttpHeaders({
'Content-Type': 'application/json',
'Access-Control-Allow-Origin': '*',
'Access-Control-AllowMethods': 'GET,HEAD,PUT,PATCH,POST,DELETE'
})
};
this.http.post(url, postData, httpOptions).subscribe((data) => {
console.log('postData:', postData)
if (data == false) {
this.loginfail()
}
else if (data == true) {
this.loginsuccess()
this.modalController.dismiss();
}
}, error => {
console.log(error);
});
}
Solution
Currently Your App is calling below Api for login
https://skippyforvercel.vercel.app/login
Its POST method , I tested this Api in POST man getting a 405 status code, currently your server is not supporting POST method Please raise issue to Server Team.
Answered By - Rahul Cv
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.