mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-10-05 02:39:33 +02:00
Add typescript (and angular2) linter
This commit is contained in:
parent
0dde91ff15
commit
44124980c5
9 changed files with 69 additions and 21 deletions
|
@ -2,19 +2,18 @@ import { Injectable } from 'angular2/core';
|
|||
import { Http, Response, Headers, URLSearchParams } from 'angular2/http';
|
||||
import { Observable, Subject } from 'rxjs/Rx';
|
||||
|
||||
import { Token } from '../models/token';
|
||||
import { AuthStatus } from '../models/authStatus';
|
||||
|
||||
@Injectable()
|
||||
export class AuthService {
|
||||
loginChanged$ = this._loginChanged.asObservable();
|
||||
|
||||
private _loginChanged = new Subject<AuthStatus>();
|
||||
|
||||
private _baseLoginUrl = '/api/v1/users/token';
|
||||
private _clientId = '56f055587305d40b21904240';
|
||||
private _clientSecret = 'megustalabanana';
|
||||
|
||||
loginChanged$ = this._loginChanged.asObservable();
|
||||
|
||||
constructor (private http: Http) {}
|
||||
|
||||
login(username: string, password: string) {
|
||||
|
@ -32,7 +31,7 @@ export class AuthService {
|
|||
|
||||
let options = {
|
||||
headers: headers
|
||||
}
|
||||
};
|
||||
|
||||
return this.http.post(this._baseLoginUrl, body.toString(), options)
|
||||
.map(res => res.json())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue