X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=client%2Fangular%2Fusers%2Fservices%2Fauth.service.ts;h=80886346ca529f39d841e084df51184bd09aa24b;hb=44124980c55d5a5ec7dfb8e71bf14d10f0fe975d;hp=a512c3d9cda2697911d9cfd92bd81154526ef1f1;hpb=0dde91ff15ec3cb73d39da50b388e5e525160cb4;p=github%2FChocobozzz%2FPeerTube.git 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'; 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(); 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())