1
|
import {COOKIE} from '../../login/utils/helper.class';
|
2
|
import {HttpHeaders} from "@angular/common/http";
|
3
|
|
4
|
|
5
|
export class CustomOptions {
|
6
|
|
7
|
/*
|
8
|
public static getAuthOptionsWithBody(): RequestOptions {
|
9
|
const headers = new Headers();
|
10
|
headers.append('Content-Type', 'application/json');
|
11
|
headers.append('X-XSRF-TOKEN', COOKIE.getCookie(COOKIE.cookieName_id));
|
12
|
const options = new RequestOptions({ headers: headers, withCredentials: true });
|
13
|
return options;
|
14
|
}
|
15
|
*/
|
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)?COOKIE.getCookie(COOKIE.cookieName_id):''
|
22
|
}), withCredentials: true
|
23
|
};
|
24
|
}
|
25
|
|
26
|
/*
|
27
|
public static getAuthOptions(): RequestOptions {
|
28
|
const headers = new Headers();
|
29
|
headers.append('X-XSRF-TOKEN', COOKIE.getCookie(COOKIE.cookieName_id));
|
30
|
const options = new RequestOptions({ headers: headers, withCredentials: true });
|
31
|
return options;
|
32
|
}
|
33
|
*/
|
34
|
|
35
|
public static getAuthOptions():any {
|
36
|
const httpOptions = {
|
37
|
headers: new HttpHeaders({
|
38
|
'X-XSRF-TOKEN': (COOKIE.getCookie(COOKIE.cookieName_id))?COOKIE.getCookie(COOKIE.cookieName_id):'',
|
39
|
}), withCredentials: true
|
40
|
};
|
41
|
return httpOptions;
|
42
|
}
|
43
|
|
44
|
}
|