From 80f8e364e1df4005e95c9e207d38d758794e37f6 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 29 Dec 2017 09:22:23 +0100 Subject: Use server error message on login --- client/src/app/login/login.component.ts | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'client/src/app/login/login.component.ts') 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 ) } } -- cgit v1.2.3