]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/login/login.component.ts
Add avatar in comments
[github/Chocobozzz/PeerTube.git] / client / src / app / login / login.component.ts
index 77703a80c11b78636d3b5f9897560d5d9df1c51c..e7c9c722632a3dfdb6504a7705ea5fe3c65a7513 100644 (file)
@@ -7,7 +7,8 @@ import { FormReactive } from '../shared'
 
 @Component({
   selector: 'my-login',
-  templateUrl: './login.component.html'
+  templateUrl: './login.component.html',
+  styleUrls: [ './login.component.scss' ]
 })
 
 export class LoginComponent extends FormReactive implements OnInit {
@@ -54,17 +55,9 @@ export class LoginComponent extends FormReactive implements OnInit {
     const { username, password } = this.form.value
 
     this.authService.login(username, password).subscribe(
-      result => this.router.navigate(['/videos/list']),
+      () => this.router.navigate(['/videos/list']),
 
-      error => {
-        console.error(error.json)
-
-        if (error.json.error === 'invalid_grant') {
-          this.error = 'Credentials are invalid.'
-        } else {
-          this.error = `${error.json.error}: ${error.json.error_description}`
-        }
-      }
+      err => this.error = err.message
     )
   }
 }