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 (keyup.enter)="login()">
<mat-label>Passwort eingebene</mat-label>
<mat-label>Passwort eingeben</mat-label>
<input
matInput
[type]="hide ? 'password' : 'text'"

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

@ -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;
});
}
)
}
}

@ -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);

Loading…
Cancel
Save