Revision 55964
Added by Argiro Kokogiannaki almost 5 years ago
customOptions.class.ts | ||
---|---|---|
1 |
import { RequestOptions, Headers} from '@angular/http';
|
|
2 |
import { COOKIE } from '../../login/utils/helper.class';
|
|
1 |
import {COOKIE} from '../../login/utils/helper.class';
|
|
2 |
import {HttpHeaders} from "@angular/common/http";
|
|
3 | 3 |
|
4 | 4 |
|
5 | 5 |
export class CustomOptions { |
6 | 6 |
|
7 |
/* |
|
7 | 8 |
public static getAuthOptionsWithBody(): RequestOptions { |
8 | 9 |
const headers = new Headers(); |
9 | 10 |
headers.append('Content-Type', 'application/json'); |
... | ... | |
11 | 12 |
const options = new RequestOptions({ headers: headers, withCredentials: true }); |
12 | 13 |
return options; |
13 | 14 |
} |
15 |
*/ |
|
14 | 16 |
|
17 |
public static getAuthOptionsWithBody():{} { |
|
18 |
return { |
|
19 |
headers: new HttpHeaders({ |
|
20 |
'Content-Type': 'application/json', |
|
21 |
'X-XSRF-TOKEN': COOKIE.getCookie(COOKIE.cookieName_id) |
|
22 |
}), withCredentials: true |
|
23 |
}; |
|
24 |
} |
|
25 |
|
|
26 |
/* |
|
15 | 27 |
public static getAuthOptions(): RequestOptions { |
16 | 28 |
const headers = new Headers(); |
17 | 29 |
headers.append('X-XSRF-TOKEN', COOKIE.getCookie(COOKIE.cookieName_id)); |
18 | 30 |
const options = new RequestOptions({ headers: headers, withCredentials: true }); |
19 | 31 |
return options; |
20 | 32 |
} |
33 |
*/ |
|
21 | 34 |
|
35 |
public static getAuthOptions():any { |
|
36 |
const httpOptions = { |
|
37 |
headers: new HttpHeaders({ |
|
38 |
'X-XSRF-TOKEN': COOKIE.getCookie(COOKIE.cookieName_id), |
|
39 |
}), withCredentials: true |
|
40 |
}; |
|
41 |
return httpOptions; |
|
42 |
} |
|
43 |
|
|
22 | 44 |
} |
Also available in: Unified diff
[Library|Trunk]
Merge into trunk branch angular7 rev 55729