]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/+reset-password/reset-password.component.ts
Translated using Weblate (Persian)
[github/Chocobozzz/PeerTube.git] / client / src / app / +reset-password / reset-password.component.ts
index ce9144170b7ba64d34b83447c0c35358dfe02452..a6c05bbfb0d47789aa047c687e72fa6d26e84d15 100644 (file)
@@ -3,7 +3,7 @@ import { ActivatedRoute, Router } from '@angular/router'
 import { Notifier, UserService } from '@app/core'
 import { RESET_PASSWORD_CONFIRM_VALIDATOR } from '@app/shared/form-validators/reset-password-validators'
 import { USER_PASSWORD_VALIDATOR } from '@app/shared/form-validators/user-validators'
-import { FormReactive, FormValidatorService } from '@app/shared/shared-forms'
+import { FormReactive, FormReactiveService } from '@app/shared/shared-forms'
 
 @Component({
   selector: 'my-login',
@@ -16,12 +16,12 @@ export class ResetPasswordComponent extends FormReactive implements OnInit {
   private verificationString: string
 
   constructor (
-    protected formValidatorService: FormValidatorService,
+    protected formReactiveService: FormReactiveService,
     private userService: UserService,
     private notifier: Notifier,
     private router: Router,
     private route: ActivatedRoute
-    ) {
+  ) {
     super()
   }
 
@@ -42,14 +42,15 @@ export class ResetPasswordComponent extends FormReactive implements OnInit {
 
   resetPassword () {
     this.userService.resetPassword(this.userId, this.verificationString, this.form.value.password)
-      .subscribe(
-        () => {
+      .subscribe({
+        next: () => {
           this.notifier.success($localize`Your password has been successfully reset!`)
+
           this.router.navigate([ '/login' ])
         },
 
-        err => this.notifier.error(err.message)
-      )
+        error: err => this.notifier.error(err.message)
+      })
   }
 
   isConfirmedPasswordValid () {