Add response headers for real fix

This commit is contained in:
2025-06-25 20:56:04 -07:00
parent efab9bfa5d
commit f4133bc72d
@@ -31,25 +31,20 @@ export class ForgotPasswordComponent {
const body = new HttpParams() const body = new HttpParams()
.set("Email", this.email) .set("Email", this.email)
const headers = new HttpHeaders({ const headers = new HttpHeaders({
'Content-Type': 'application/x-www-form-urlencoded' 'Content-Type': 'application/x-www-form-urlencoded',
}); });
try{ this.http.post( "https://mistox.com/api/account/sendresetpassword", body, { headers, responseType: "text" } ).subscribe({
this.http.post<string>( "https://mistox.com/api/account/sendresetpassword", body, { headers } ).subscribe({ next: (data) => {
next: (data) => { if (data.trim() == "Success"){
if (data.trim() == "Success"){ this.errorMsgs = ["Reset password send"];
this.errorMsgs = ["Reset password send"]; setTimeout(() => { this.router.navigate([this.returnURL]); }, 3000);
setTimeout(() => { this.router.navigate([this.returnURL]); }, 3000); }else{
}else{ this.errorMsgs = [data];
this.errorMsgs = [data]; }
} },
}, error: err => {
error: err => { console.log("HTTP Error Signing In: ", err);
console.log("HTTP Error Signing In: ", err); }
} });
});
}catch(err){
this.errorMsgs.push("http error: " + err);
}
} }
} }