diff --git a/src/app/pages/login/login.component.html b/src/app/pages/login/login.component.html index 119f960..29f2c04 100644 --- a/src/app/pages/login/login.component.html +++ b/src/app/pages/login/login.component.html @@ -12,7 +12,7 @@ - Passwort eingebene + Passwort eingeben this.router.navigateByUrl(this.returnUrl), (error) => { + console.log(JSON.stringify(error)); this.errorOccurred = true; this.errorMessage = error.error.message || diff --git a/src/app/pages/profile/profile.component.ts b/src/app/pages/profile/profile.component.ts index bf23833..3ea5a54 100644 --- a/src/app/pages/profile/profile.component.ts +++ b/src/app/pages/profile/profile.component.ts @@ -61,17 +61,23 @@ export class ProfileComponent implements OnInit { user.password = this.passwordNew.value; this.loading = true; - this.userService + this.authService.refreshToken().subscribe( + () => { + this.userService .updateUser(user) .subscribe( data => { this.snackBar.openSnackBar("Das Passwort wurde erfolgreich aktualisiert", "Ok"); - console.log(JSON.stringify(data)); + this.password.reset(); + this.pwGroup.reset(); } ) .add(() => { this.loading = false; }); + } + ) + } } diff --git a/src/app/services/auth.service.ts b/src/app/services/auth.service.ts index aab18d8..a77a8ba 100644 --- a/src/app/services/auth.service.ts +++ b/src/app/services/auth.service.ts @@ -113,7 +113,7 @@ export class AuthService { this.currentUserSubject.next(usr); } - private removeTokens() { + public removeTokens() { //localStorage.removeItem(this.REQUEST_TOKEN); //localStorage.removeItem(this.REFRESH_TOKEN); localStorage.removeItem(this.CURRENT_USER);