aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/login
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2016-07-20 16:24:18 +0200
committerChocobozzz <florian.bigard@gmail.com>2016-07-20 16:25:06 +0200
commitbd5c83a8cb46eb6da2b25df3b1f6a2a5795d1869 (patch)
tree66df283a1554f27b92e392fca36b8e272d7535bc /client/src/app/login
parent2f372a865487427ff97ad17edd0e6adfbb478c80 (diff)
downloadPeerTube-bd5c83a8cb46eb6da2b25df3b1f6a2a5795d1869.tar.gz
PeerTube-bd5c83a8cb46eb6da2b25df3b1f6a2a5795d1869.tar.zst
PeerTube-bd5c83a8cb46eb6da2b25df3b1f6a2a5795d1869.zip
Client: Add authHttp service that authentificates the http request and
optionally refresh the access token if needed
Diffstat (limited to 'client/src/app/login')
-rw-r--r--client/src/app/login/login.component.ts9
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 @@
1import { Component } from '@angular/core'; 1import { Component } from '@angular/core';
2import { Router } from '@angular/router'; 2import { Router } from '@angular/router';
3 3
4import { AuthService, AuthStatus, User } from '../shared'; 4import { 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 {