]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/+login/login.component.ts
Fix forgot password button role
[github/Chocobozzz/PeerTube.git] / client / src / app / +login / login.component.ts
index 9731383afc78cb1a1b0c61e78689389368d49bfa..1fa4bd3b5f4092b08e6ad106b5a7e9d937ec8a82 100644 (file)
@@ -46,7 +46,7 @@ export class LoginComponent extends FormReactive implements OnInit, AfterViewIni
     private redirectService: RedirectService,
     private notifier: Notifier,
     private hooks: HooksService
-    ) {
+  ) {
     super()
   }
 
@@ -107,17 +107,17 @@ export class LoginComponent extends FormReactive implements OnInit, AfterViewIni
     const { username, password } = this.form.value
 
     this.authService.login(username, password)
-      .subscribe(
-        () => this.redirectService.redirectToPreviousRoute(),
+      .subscribe({
+        next: () => this.redirectService.redirectToPreviousRoute(),
 
-        err => this.handleError(err)
-      )
+        error: err => this.handleError(err)
+      })
   }
 
   askResetPassword () {
     this.userService.askResetPassword(this.forgotPasswordEmail)
-      .subscribe(
-        () => {
+      .subscribe({
+        next: () => {
           const message = $localize`An email with the reset password instructions will be sent to ${this.forgotPasswordEmail}.
 The link will expire within 1 hour.`
 
@@ -125,8 +125,8 @@ The link will expire within 1 hour.`
           this.hideForgotPasswordModal()
         },
 
-        err => this.notifier.error(err.message)
-      )
+        error: err => this.notifier.error(err.message)
+      })
   }
 
   openForgotPasswordModal () {
@@ -149,14 +149,14 @@ The link will expire within 1 hour.`
     this.isAuthenticatedWithExternalAuth = true
 
     this.authService.login(username, null, token)
-    .subscribe(
-      () => this.redirectService.redirectToPreviousRoute(),
-
-      err => {
-        this.handleError(err)
-        this.isAuthenticatedWithExternalAuth = false
-      }
-    )
+      .subscribe({
+        next: () => this.redirectService.redirectToPreviousRoute(),
+
+        error: err => {
+          this.handleError(err)
+          this.isAuthenticatedWithExternalAuth = false
+        }
+      })
   }
 
   private handleError (err: any) {