aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/+my-account/my-account-settings/my-account-change-password
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-08-17 14:42:53 +0200
committerChocobozzz <me@florianbigard.com>2021-08-18 08:35:06 +0200
commit9df52d660feb722404be00a50f3c8a612bec1c15 (patch)
treedde52880fa012874d24c60f64eb596b0a789cc8b /client/src/app/+my-account/my-account-settings/my-account-change-password
parentadb8809d43648ea0a64d6845bb39aa3bd0e005a6 (diff)
downloadPeerTube-9df52d660feb722404be00a50f3c8a612bec1c15.tar.gz
PeerTube-9df52d660feb722404be00a50f3c8a612bec1c15.tar.zst
PeerTube-9df52d660feb722404be00a50f3c8a612bec1c15.zip
Migrate client to eslint
Diffstat (limited to 'client/src/app/+my-account/my-account-settings/my-account-change-password')
-rw-r--r--client/src/app/+my-account/my-account-settings/my-account-change-password/my-account-change-password.component.ts14
1 files changed, 9 insertions, 5 deletions
diff --git a/client/src/app/+my-account/my-account-settings/my-account-change-password/my-account-change-password.component.ts b/client/src/app/+my-account/my-account-settings/my-account-change-password/my-account-change-password.component.ts
index f91b2f37b..47e54dc23 100644
--- a/client/src/app/+my-account/my-account-settings/my-account-change-password/my-account-change-password.component.ts
+++ b/client/src/app/+my-account/my-account-settings/my-account-change-password/my-account-change-password.component.ts
@@ -1,7 +1,11 @@
1import { filter } from 'rxjs/operators' 1import { filter } from 'rxjs/operators'
2import { Component, OnInit } from '@angular/core' 2import { Component, OnInit } from '@angular/core'
3import { AuthService, Notifier, UserService } from '@app/core' 3import { AuthService, Notifier, UserService } from '@app/core'
4import { USER_CONFIRM_PASSWORD_VALIDATOR, USER_PASSWORD_VALIDATOR, USER_EXISTING_PASSWORD_VALIDATOR } from '@app/shared/form-validators/user-validators' 4import {
5 USER_CONFIRM_PASSWORD_VALIDATOR,
6 USER_EXISTING_PASSWORD_VALIDATOR,
7 USER_PASSWORD_VALIDATOR
8} from '@app/shared/form-validators/user-validators'
5import { FormReactive, FormValidatorService } from '@app/shared/shared-forms' 9import { FormReactive, FormValidatorService } from '@app/shared/shared-forms'
6import { User } from '@shared/models' 10import { User } from '@shared/models'
7 11
@@ -19,7 +23,7 @@ export class MyAccountChangePasswordComponent extends FormReactive implements On
19 private notifier: Notifier, 23 private notifier: Notifier,
20 private authService: AuthService, 24 private authService: AuthService,
21 private userService: UserService 25 private userService: UserService
22 ) { 26 ) {
23 super() 27 super()
24 } 28 }
25 29
@@ -35,13 +39,13 @@ export class MyAccountChangePasswordComponent extends FormReactive implements On
35 const confirmPasswordControl = this.form.get('new-confirmed-password') 39 const confirmPasswordControl = this.form.get('new-confirmed-password')
36 40
37 confirmPasswordControl.valueChanges 41 confirmPasswordControl.valueChanges
38 .pipe(filter(v => v !== this.form.value[ 'new-password' ])) 42 .pipe(filter(v => v !== this.form.value['new-password']))
39 .subscribe(() => confirmPasswordControl.setErrors({ matchPassword: true })) 43 .subscribe(() => confirmPasswordControl.setErrors({ matchPassword: true }))
40 } 44 }
41 45
42 changePassword () { 46 changePassword () {
43 const currentPassword = this.form.value[ 'current-password' ] 47 const currentPassword = this.form.value['current-password']
44 const newPassword = this.form.value[ 'new-password' ] 48 const newPassword = this.form.value['new-password']
45 49
46 this.userService.changePassword(currentPassword, newPassword) 50 this.userService.changePassword(currentPassword, newPassword)
47 .subscribe({ 51 .subscribe({