From: Chocobozzz Date: Fri, 29 Dec 2017 08:22:23 +0000 (+0100) Subject: Use server error message on login X-Git-Tag: v0.0.1-alpha~69 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=80f8e364e1df4005e95c9e207d38d758794e37f6;p=oweals%2Fpeertube.git Use server error message on login --- diff --git a/client/src/app/login/login.component.ts b/client/src/app/login/login.component.ts index dfede5924..e7c9c7226 100644 --- a/client/src/app/login/login.component.ts +++ b/client/src/app/login/login.component.ts @@ -55,15 +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']), - err => { - if (err.message === 'invalid_grant') { - this.error = 'Credentials are invalid.' - } else { - this.error = `${err.body.error_description}` - } - } + err => this.error = err.message ) } }