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({
|
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]);
|
||||||
|
|||||||
+5
-4
@@ -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 => {
|
||||||
|
|||||||
Reference in New Issue
Block a user