diff options
Diffstat (limited to 'client/src/app/login')
-rw-r--r-- | client/src/app/login/login.component.ts | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/client/src/app/login/login.component.ts b/client/src/app/login/login.component.ts index bcfa021fa..ddd62462e 100644 --- a/client/src/app/login/login.component.ts +++ b/client/src/app/login/login.component.ts | |||
@@ -1,7 +1,7 @@ | |||
1 | import { Component } from '@angular/core'; | 1 | import { Component } from '@angular/core'; |
2 | import { Router } from '@angular/router'; | 2 | import { Router } from '@angular/router'; |
3 | 3 | ||
4 | import { AuthService, AuthStatus, User } from '../shared'; | 4 | import { AuthService } from '../shared'; |
5 | 5 | ||
6 | @Component({ | 6 | @Component({ |
7 | selector: 'my-login', | 7 | selector: 'my-login', |
@@ -21,14 +21,11 @@ export class LoginComponent { | |||
21 | result => { | 21 | result => { |
22 | this.error = null; | 22 | this.error = null; |
23 | 23 | ||
24 | const user = new User(username, result); | ||
25 | user.save(); | ||
26 | |||
27 | this.authService.setStatus(AuthStatus.LoggedIn); | ||
28 | |||
29 | this.router.navigate(['/videos/list']); | 24 | this.router.navigate(['/videos/list']); |
30 | }, | 25 | }, |
31 | error => { | 26 | error => { |
27 | console.error(error); | ||
28 | |||
32 | if (error.error === 'invalid_grant') { | 29 | if (error.error === 'invalid_grant') { |
33 | this.error = 'Credentials are invalid.'; | 30 | this.error = 'Credentials are invalid.'; |
34 | } else { | 31 | } else { |