diff options
Diffstat (limited to 'client/src/app/shared/auth/auth-http.service.ts')
-rw-r--r-- | client/src/app/shared/auth/auth-http.service.ts | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/client/src/app/shared/auth/auth-http.service.ts b/client/src/app/shared/auth/auth-http.service.ts index 2392898ca..602726570 100644 --- a/client/src/app/shared/auth/auth-http.service.ts +++ b/client/src/app/shared/auth/auth-http.service.ts | |||
@@ -7,11 +7,12 @@ import { | |||
7 | RequestMethod, | 7 | RequestMethod, |
8 | RequestOptions, | 8 | RequestOptions, |
9 | RequestOptionsArgs, | 9 | RequestOptionsArgs, |
10 | Response | 10 | Response, |
11 | XHRBackend | ||
11 | } from '@angular/http'; | 12 | } from '@angular/http'; |
12 | import { Observable } from 'rxjs/Observable'; | 13 | import { Observable } from 'rxjs/Observable'; |
13 | 14 | ||
14 | import { AuthService } from './auth.service'; | 15 | import { AuthService } from '../../core'; |
15 | 16 | ||
16 | @Injectable() | 17 | @Injectable() |
17 | export class AuthHttp extends Http { | 18 | export class AuthHttp extends Http { |
@@ -78,3 +79,13 @@ export class AuthHttp extends Http { | |||
78 | headers.set('Authorization', this.authService.getRequestHeaderValue()); | 79 | headers.set('Authorization', this.authService.getRequestHeaderValue()); |
79 | } | 80 | } |
80 | } | 81 | } |
82 | |||
83 | export const AUTH_HTTP_PROVIDERS = [ | ||
84 | { | ||
85 | provide: AuthHttp, | ||
86 | useFactory: (backend: XHRBackend, defaultOptions: RequestOptions, authService: AuthService) => { | ||
87 | return new AuthHttp(backend, defaultOptions, authService); | ||
88 | }, | ||
89 | deps: [ XHRBackend, RequestOptions, AuthService ] | ||
90 | }, | ||
91 | ]; | ||