- // compare old password
- this.authService.login(this.user.account.name, oldPassword)
- .subscribe(
- () => this.changePassword(),
- err => {
- if (err.message.indexOf('credentials are invalid') !== -1) this.error = this.i18n('Incorrect old password.')
- else this.error = err.message
- }
- )
-
- }
-
- private changePassword(){
- this.userService.changePassword(this.form.value[ 'new-password' ]).subscribe(