aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src
diff options
context:
space:
mode:
Diffstat (limited to 'client/src')
-rw-r--r--client/src/app/login/login.component.ts8
-rw-r--r--client/src/app/shared/rest/rest-extractor.service.ts4
2 files changed, 6 insertions, 6 deletions
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 {
56 this.authService.login(username, password).subscribe( 56 this.authService.login(username, password).subscribe(
57 result => this.router.navigate(['/videos/list']), 57 result => this.router.navigate(['/videos/list']),
58 58
59 error => { 59 err => {
60 console.error(error.json) 60 if (err.message === 'invalid_grant') {
61
62 if (error.json.error === 'invalid_grant') {
63 this.error = 'Credentials are invalid.' 61 this.error = 'Credentials are invalid.'
64 } else { 62 } else {
65 this.error = `${error.json.error}: ${error.json.error_description}` 63 this.error = `${err.body.error_description}`
66 } 64 }
67 } 65 }
68 ) 66 )
diff --git a/client/src/app/shared/rest/rest-extractor.service.ts b/client/src/app/shared/rest/rest-extractor.service.ts
index 62c600d25..aafc9723e 100644
--- a/client/src/app/shared/rest/rest-extractor.service.ts
+++ b/client/src/app/shared/rest/rest-extractor.service.ts
@@ -54,11 +54,13 @@ export class RestExtractor {
54 54
55 const errorObj = { 55 const errorObj = {
56 message: errorMessage, 56 message: errorMessage,
57 status: undefined 57 status: undefined,
58 body: undefined
58 } 59 }
59 60
60 if (err.status) { 61 if (err.status) {
61 errorObj.status = err.status 62 errorObj.status = err.status
63 errorObj.body = err.error
62 } 64 }
63 65
64 return Observable.throw(errorObj) 66 return Observable.throw(errorObj)