diff options
Diffstat (limited to 'client/angular/users/services/auth.service.ts')
-rw-r--r-- | client/angular/users/services/auth.service.ts | 7 |
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'; | |||
2 | import { Http, Response, Headers, URLSearchParams } from 'angular2/http'; | 2 | import { Http, Response, Headers, URLSearchParams } from 'angular2/http'; |
3 | import { Observable, Subject } from 'rxjs/Rx'; | 3 | import { Observable, Subject } from 'rxjs/Rx'; |
4 | 4 | ||
5 | import { Token } from '../models/token'; | ||
6 | import { AuthStatus } from '../models/authStatus'; | 5 | import { AuthStatus } from '../models/authStatus'; |
7 | 6 | ||
8 | @Injectable() | 7 | @Injectable() |
9 | export class AuthService { | 8 | export 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()) |