From c9d6d155c397d0da0cb2d50064264fc1716f0501 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 15 Sep 2017 12:26:02 +0200 Subject: Fix login when there is an error --- client/src/app/login/login.component.ts | 8 +++----- 1 file changed, 3 insertions(+), 5 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 77703a80c..32dc9e36f 100644 --- a/client/src/app/login/login.component.ts +++ b/client/src/app/login/login.component.ts @@ -56,13 +56,11 @@ export class LoginComponent extends FormReactive implements OnInit { this.authService.login(username, password).subscribe( result => this.router.navigate(['/videos/list']), - error => { - console.error(error.json) - - if (error.json.error === 'invalid_grant') { + err => { + if (err.message === 'invalid_grant') { this.error = 'Credentials are invalid.' } else { - this.error = `${error.json.error}: ${error.json.error_description}` + this.error = `${err.body.error_description}` } } ) -- cgit v1.2.3