This commit is contained in:
2025-06-25 20:17:01 -07:00
parent b9c9fcbcb2
commit 634a1f3a64
2 changed files with 6 additions and 5 deletions
@@ -39,7 +39,7 @@ export class ForgotPasswordComponent {
}); });
this.http.post<string>( "https://mistox.com/api/account/sendresetpassword", body, { headers } ).subscribe({ this.http.post<string>( "https://mistox.com/api/account/sendresetpassword", body, { headers } ).subscribe({
next: async (data) => { next: async (data) => {
if (data == "Success"){ if (data.trim() == "Success"){
this.errorMsgs = ["Reset password send"]; this.errorMsgs = ["Reset password send"];
await this.sleep(3000); await this.sleep(3000);
this.router.navigate([this.returnURL]); this.router.navigate([this.returnURL]);
@@ -50,15 +50,16 @@ export class ResetPasswordComponent {
const headers = new HttpHeaders({ const headers = new HttpHeaders({
'Content-Type': 'application/x-www-form-urlencoded' 'Content-Type': 'application/x-www-form-urlencoded'
}); });
this.http.post<string>( "https://mistox.com/api/account/sendresetpassword", body, { headers } ).subscribe({ this.http.post<boolean>( "https://mistox.com/api/account/resetpassword", body, { headers } ).subscribe({
next: async (data) => { next: async (data) => {
if (data == "true"){ if (data == true){
this.errorMsgs = ["Password reset successfully"]; this.errorMsgs = ["Password reset successfully"];
await this.sleep(3000); await this.sleep(3000);
this.router.navigate(["/account/login"]); this.router.navigate(["/account/login"]);
}else{ }else{
this.errorMsgs = []; this.errorMsgs = ["An error has ocurred"];
this.errorMsgs.push(data); await this.sleep(3000);
this.router.navigate(["/account/sendresetpassword"]);
} }
}, },
error: err => { error: err => {