bug fix
This commit is contained in:
+1
-1
@@ -39,7 +39,7 @@ export class ForgotPasswordComponent {
|
||||
});
|
||||
this.http.post<string>( "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]);
|
||||
|
||||
+5
-4
@@ -50,15 +50,16 @@ export class ResetPasswordComponent {
|
||||
const headers = new HttpHeaders({
|
||||
'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) => {
|
||||
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 => {
|
||||
|
||||
Reference in New Issue
Block a user