Add response headers for real fix
This commit is contained in:
+14
-19
@@ -31,25 +31,20 @@ export class ForgotPasswordComponent {
|
||||
const body = new HttpParams()
|
||||
.set("Email", this.email)
|
||||
const headers = new HttpHeaders({
|
||||
'Content-Type': 'application/x-www-form-urlencoded'
|
||||
'Content-Type': 'application/x-www-form-urlencoded',
|
||||
});
|
||||
try{
|
||||
this.http.post<string>( "https://mistox.com/api/account/sendresetpassword", body, { headers } ).subscribe({
|
||||
next: (data) => {
|
||||
if (data.trim() == "Success"){
|
||||
this.errorMsgs = ["Reset password send"];
|
||||
setTimeout(() => { this.router.navigate([this.returnURL]); }, 3000);
|
||||
}else{
|
||||
this.errorMsgs = [data];
|
||||
}
|
||||
},
|
||||
error: err => {
|
||||
console.log("HTTP Error Signing In: ", err);
|
||||
}
|
||||
});
|
||||
}catch(err){
|
||||
this.errorMsgs.push("http error: " + err);
|
||||
}
|
||||
|
||||
this.http.post( "https://mistox.com/api/account/sendresetpassword", body, { headers, responseType: "text" } ).subscribe({
|
||||
next: (data) => {
|
||||
if (data.trim() == "Success"){
|
||||
this.errorMsgs = ["Reset password send"];
|
||||
setTimeout(() => { this.router.navigate([this.returnURL]); }, 3000);
|
||||
}else{
|
||||
this.errorMsgs = [data];
|
||||
}
|
||||
},
|
||||
error: err => {
|
||||
console.log("HTTP Error Signing In: ", err);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user