aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/login
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2017-09-15 12:26:02 +0200
committerChocobozzz <florian.bigard@gmail.com>2017-09-15 12:26:02 +0200
commitc9d6d155c397d0da0cb2d50064264fc1716f0501 (patch)
treec9f888f1d294f2097f43ffd9fc6875bdf1565007 /client/src/app/login
parentb60e5f38daf77e720a27aa86d3b482c58906a03a (diff)
downloadPeerTube-c9d6d155c397d0da0cb2d50064264fc1716f0501.tar.gz
PeerTube-c9d6d155c397d0da0cb2d50064264fc1716f0501.tar.zst
PeerTube-c9d6d155c397d0da0cb2d50064264fc1716f0501.zip
Fix login when there is an error
Diffstat (limited to 'client/src/app/login')
-rw-r--r--client/src/app/login/login.component.ts8
1 files changed, 3 insertions, 5 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 )