Use server error message on login

pull/175/head
Chocobozzz 2017-12-29 09:22:23 +01:00
parent eacf925ea6
commit 80f8e364e1
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
1 changed files with 2 additions and 8 deletions

View File

@ -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
)
}
}