1
|
import { RequestOptions, Headers} from '@angular/http';
|
2
|
import { COOKIE } from '../../../login/utils/helper.class';
|
3
|
|
4
|
|
5
|
export class CustomOptions{
|
6
|
public static getAuthOptionsWithBody():RequestOptions{
|
7
|
let headers = new Headers();
|
8
|
headers.append('Content-Type', 'application/json');
|
9
|
headers.append('X-XSRF-TOKEN', COOKIE.getCookie(COOKIE.cookieName_id));
|
10
|
let options = new RequestOptions({ headers: headers, withCredentials:true });
|
11
|
return options;
|
12
|
}
|
13
|
public static getAuthOptions():RequestOptions{
|
14
|
let headers = new Headers();
|
15
|
headers.append('X-XSRF-TOKEN', COOKIE.getCookie(COOKIE.cookieName_id));
|
16
|
let options = new RequestOptions({ headers: headers, withCredentials:true });
|
17
|
return options;
|
18
|
}
|
19
|
}
|