changed pw reset behavior

pull/8/head
FlayInAHook 4 years ago
parent a304d897fd
commit 142553d3b6

@ -12,7 +12,7 @@
</mat-form-field> </mat-form-field>
<mat-form-field (keyup.enter)="login()"> <mat-form-field (keyup.enter)="login()">
<mat-label>Passwort eingebene</mat-label> <mat-label>Passwort eingeben</mat-label>
<input <input
matInput matInput
[type]="hide ? 'password' : 'text'" [type]="hide ? 'password' : 'text'"

@ -36,6 +36,7 @@ export class LoginComponent implements OnInit {
.subscribe( .subscribe(
() => this.router.navigateByUrl(this.returnUrl), () => this.router.navigateByUrl(this.returnUrl),
(error) => { (error) => {
console.log(JSON.stringify(error));
this.errorOccurred = true; this.errorOccurred = true;
this.errorMessage = this.errorMessage =
error.error.message || error.error.message ||

@ -61,18 +61,24 @@ export class ProfileComponent implements OnInit {
user.password = this.passwordNew.value; user.password = this.passwordNew.value;
this.loading = true; this.loading = true;
this.authService.refreshToken().subscribe(
() => {
this.userService this.userService
.updateUser(user) .updateUser(user)
.subscribe( .subscribe(
data => { data => {
this.snackBar.openSnackBar("Das Passwort wurde erfolgreich aktualisiert", "Ok"); this.snackBar.openSnackBar("Das Passwort wurde erfolgreich aktualisiert", "Ok");
console.log(JSON.stringify(data)); this.password.reset();
this.pwGroup.reset();
} }
) )
.add(() => { .add(() => {
this.loading = false; this.loading = false;
}); });
} }
)
}
} }

@ -113,7 +113,7 @@ export class AuthService {
this.currentUserSubject.next(usr); this.currentUserSubject.next(usr);
} }
private removeTokens() { public removeTokens() {
//localStorage.removeItem(this.REQUEST_TOKEN); //localStorage.removeItem(this.REQUEST_TOKEN);
//localStorage.removeItem(this.REFRESH_TOKEN); //localStorage.removeItem(this.REFRESH_TOKEN);
localStorage.removeItem(this.CURRENT_USER); localStorage.removeItem(this.CURRENT_USER);

Loading…
Cancel
Save