diff --git a/src/MistoxWebsite.Client/src/app/pages/account/forgotpassword/forgotpassword.component.ts b/src/MistoxWebsite.Client/src/app/pages/account/forgotpassword/forgotpassword.component.ts index a181843..70b289c 100644 --- a/src/MistoxWebsite.Client/src/app/pages/account/forgotpassword/forgotpassword.component.ts +++ b/src/MistoxWebsite.Client/src/app/pages/account/forgotpassword/forgotpassword.component.ts @@ -39,7 +39,7 @@ export class ForgotPasswordComponent { }); this.http.post( "https://mistox.com/api/account/sendresetpassword", body, { headers } ).subscribe({ next: async (data) => { - if (data == "Success"){ + if (data.trim() == "Success"){ this.errorMsgs = ["Reset password send"]; await this.sleep(3000); this.router.navigate([this.returnURL]); diff --git a/src/MistoxWebsite.Client/src/app/pages/account/resetpassword/resetpassword.component.ts b/src/MistoxWebsite.Client/src/app/pages/account/resetpassword/resetpassword.component.ts index 973f0f3..1edcce0 100644 --- a/src/MistoxWebsite.Client/src/app/pages/account/resetpassword/resetpassword.component.ts +++ b/src/MistoxWebsite.Client/src/app/pages/account/resetpassword/resetpassword.component.ts @@ -50,15 +50,16 @@ export class ResetPasswordComponent { const headers = new HttpHeaders({ 'Content-Type': 'application/x-www-form-urlencoded' }); - this.http.post( "https://mistox.com/api/account/sendresetpassword", body, { headers } ).subscribe({ + this.http.post( "https://mistox.com/api/account/resetpassword", body, { headers } ).subscribe({ next: async (data) => { - if (data == "true"){ + if (data == true){ this.errorMsgs = ["Password reset successfully"]; await this.sleep(3000); this.router.navigate(["/account/login"]); }else{ - this.errorMsgs = []; - this.errorMsgs.push(data); + this.errorMsgs = ["An error has ocurred"]; + await this.sleep(3000); + this.router.navigate(["/account/sendresetpassword"]); } }, error: err => {