diff --git a/src/MistoxWebsite.Client/src/app/pages/account/forgotpassword/forgotpassword.component.html b/src/MistoxWebsite.Client/src/app/pages/account/forgotpassword/forgotpassword.component.html
index d7f0e99..09575dc 100644
--- a/src/MistoxWebsite.Client/src/app/pages/account/forgotpassword/forgotpassword.component.html
+++ b/src/MistoxWebsite.Client/src/app/pages/account/forgotpassword/forgotpassword.component.html
@@ -15,7 +15,7 @@
-
- - {{ msg }}
+
\ No newline at end of file
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 be274d2..2aa63dc 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
@@ -15,17 +15,13 @@ export class ForgotPasswordComponent {
errorMsgs: string[] = [];
returnURL: string = '/';
- constructor( private http: HttpClient, private router: Router, private route: ActivatedRoute, private title: Title, private changeDetector: ChangeDetectorRef ) {
+ constructor( private http: HttpClient, private router: Router, private route: ActivatedRoute, private title: Title) {
this.title.setTitle("Forgot Password | Mistox");
this.route.queryParams.subscribe(params => {
this.returnURL = params['returnURL'] || '/';
});
}
- sleep(ms: number) {
- return new Promise(resolve => setTimeout(resolve, ms));
- }
-
onSubmit() {
// Clear errors
this.errorMsgs = [];
@@ -38,15 +34,12 @@ export class ForgotPasswordComponent {
'Content-Type': 'application/x-www-form-urlencoded'
});
this.http.post( "https://mistox.com/api/account/sendresetpassword", body, { headers } ).subscribe({
- next: async (data) => {
+ next: (data) => {
if (data.trim() == "Success"){
this.errorMsgs = ["Reset password send"];
- this.changeDetector.detectChanges();
- await this.sleep(3000);
- this.router.navigate([this.returnURL]);
+ setTimeout(() => { this.router.navigate([this.returnURL]); }, 3000);
}else{
this.errorMsgs = [data];
- this.changeDetector.detectChanges();
}
},
error: err => {
diff --git a/src/MistoxWebsite.Client/src/app/pages/account/login/login.component.html b/src/MistoxWebsite.Client/src/app/pages/account/login/login.component.html
index 3c37785..aaefb73 100644
--- a/src/MistoxWebsite.Client/src/app/pages/account/login/login.component.html
+++ b/src/MistoxWebsite.Client/src/app/pages/account/login/login.component.html
@@ -27,7 +27,7 @@
-
- - {{ msg }}
+
diff --git a/src/MistoxWebsite.Client/src/app/pages/account/register/register.component.html b/src/MistoxWebsite.Client/src/app/pages/account/register/register.component.html
index 636a68e..6c31393 100644
--- a/src/MistoxWebsite.Client/src/app/pages/account/register/register.component.html
+++ b/src/MistoxWebsite.Client/src/app/pages/account/register/register.component.html
@@ -27,7 +27,7 @@
-
- - {{ msg }}
+
diff --git a/src/MistoxWebsite.Client/src/app/pages/account/resetpassword/resetpassword.component.html b/src/MistoxWebsite.Client/src/app/pages/account/resetpassword/resetpassword.component.html
index 916b6b3..c6fb579 100644
--- a/src/MistoxWebsite.Client/src/app/pages/account/resetpassword/resetpassword.component.html
+++ b/src/MistoxWebsite.Client/src/app/pages/account/resetpassword/resetpassword.component.html
@@ -21,7 +21,7 @@
-
- - {{ msg }}
+
\ No newline at end of file
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 34fe22e..2c39755 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
@@ -19,7 +19,7 @@ export class ResetPasswordComponent {
errorMsgs: string[] = [];
- constructor( private http: HttpClient, private router: Router, private route: ActivatedRoute, private title: Title, private changeDetector: ChangeDetectorRef ) {
+ constructor( private http: HttpClient, private router: Router, private route: ActivatedRoute, private title: Title ) {
this.title.setTitle("Reset Password | Mistox");
this.route.queryParams.subscribe(params => {
this.UserName = params['UserName'] || '';
@@ -27,10 +27,6 @@ export class ResetPasswordComponent {
});
}
- sleep(ms: number) {
- return new Promise(resolve => setTimeout(resolve, ms));
- }
-
onSubmit() {
if (this.Password != this.PassworR){
@@ -51,17 +47,13 @@ export class ResetPasswordComponent {
'Content-Type': 'application/x-www-form-urlencoded'
});
this.http.post( "https://mistox.com/api/account/resetpassword", body, { headers } ).subscribe({
- next: async (data) => {
+ next: (data) => {
if (data == true){
this.errorMsgs = ["Password reset successfully"];
- this.changeDetector.detectChanges();
- await this.sleep(3000);
- this.router.navigate(["/account/login"]);
+ setTimeout(() => { this.router.navigate(["/account/login"]); }, 3000);
}else{
this.errorMsgs = ["An error has ocurred"];
- this.changeDetector.detectChanges();
- await this.sleep(3000);
- this.router.navigate(["/account/sendresetpassword"]);
+ setTimeout(() => { this.router.navigate(["/account/sendresetpassword"]); }, 3000);
}
},
error: err => {