aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/angular/users/services/auth.service.ts
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2016-04-08 20:58:07 +0200
committerChocobozzz <florian.bigard@gmail.com>2016-04-08 21:03:47 +0200
commit44124980c55d5a5ec7dfb8e71bf14d10f0fe975d (patch)
tree795191ff37d862a4bcf9cbc57cdb60b909b038d1 /client/angular/users/services/auth.service.ts
parent0dde91ff15ec3cb73d39da50b388e5e525160cb4 (diff)
downloadPeerTube-44124980c55d5a5ec7dfb8e71bf14d10f0fe975d.tar.gz
PeerTube-44124980c55d5a5ec7dfb8e71bf14d10f0fe975d.tar.zst
PeerTube-44124980c55d5a5ec7dfb8e71bf14d10f0fe975d.zip
Add typescript (and angular2) linter
Diffstat (limited to 'client/angular/users/services/auth.service.ts')
-rw-r--r--client/angular/users/services/auth.service.ts7
1 files changed, 3 insertions, 4 deletions
diff --git a/client/angular/users/services/auth.service.ts b/client/angular/users/services/auth.service.ts
index a512c3d9c..80886346c 100644
--- a/client/angular/users/services/auth.service.ts
+++ b/client/angular/users/services/auth.service.ts
@@ -2,19 +2,18 @@ import { Injectable } from 'angular2/core';
2import { Http, Response, Headers, URLSearchParams } from 'angular2/http'; 2import { Http, Response, Headers, URLSearchParams } from 'angular2/http';
3import { Observable, Subject } from 'rxjs/Rx'; 3import { Observable, Subject } from 'rxjs/Rx';
4 4
5import { Token } from '../models/token';
6import { AuthStatus } from '../models/authStatus'; 5import { AuthStatus } from '../models/authStatus';
7 6
8@Injectable() 7@Injectable()
9export class AuthService { 8export class AuthService {
9 loginChanged$ = this._loginChanged.asObservable();
10
10 private _loginChanged = new Subject<AuthStatus>(); 11 private _loginChanged = new Subject<AuthStatus>();
11 12
12 private _baseLoginUrl = '/api/v1/users/token'; 13 private _baseLoginUrl = '/api/v1/users/token';
13 private _clientId = '56f055587305d40b21904240'; 14 private _clientId = '56f055587305d40b21904240';
14 private _clientSecret = 'megustalabanana'; 15 private _clientSecret = 'megustalabanana';
15 16
16 loginChanged$ = this._loginChanged.asObservable();
17
18 constructor (private http: Http) {} 17 constructor (private http: Http) {}
19 18
20 login(username: string, password: string) { 19 login(username: string, password: string) {
@@ -32,7 +31,7 @@ export class AuthService {
32 31
33 let options = { 32 let options = {
34 headers: headers 33 headers: headers
35 } 34 };
36 35
37 return this.http.post(this._baseLoginUrl, body.toString(), options) 36 return this.http.post(this._baseLoginUrl, body.toString(), options)
38 .map(res => res.json()) 37 .map(res => res.json())