2017-12-19 13:53:46 +01:00
|
|
|
import { RequestOptions, Headers} from '@angular/http';
|
2018-11-08 14:49:40 +01:00
|
|
|
import { COOKIE } from '../../login/utils/helper.class';
|
2017-12-19 13:53:46 +01:00
|
|
|
|
|
|
|
|
2019-03-18 13:58:02 +01:00
|
|
|
export class CustomOptions {
|
|
|
|
|
|
|
|
public static getAuthOptionsWithBody(): RequestOptions {
|
|
|
|
const headers = new Headers();
|
|
|
|
headers.append('Content-Type', 'application/json');
|
|
|
|
headers.append('X-XSRF-TOKEN', COOKIE.getCookie(COOKIE.cookieName_id));
|
|
|
|
const options = new RequestOptions({ headers: headers, withCredentials: true });
|
2017-12-19 13:53:46 +01:00
|
|
|
return options;
|
|
|
|
}
|
2019-03-18 13:58:02 +01:00
|
|
|
|
|
|
|
public static getAuthOptions(): RequestOptions {
|
|
|
|
const headers = new Headers();
|
|
|
|
headers.append('X-XSRF-TOKEN', COOKIE.getCookie(COOKIE.cookieName_id));
|
|
|
|
const options = new RequestOptions({ headers: headers, withCredentials: true });
|
2017-12-19 13:53:46 +01:00
|
|
|
return options;
|
|
|
|
}
|
2019-03-18 13:58:02 +01:00
|
|
|
|
2017-12-19 13:53:46 +01:00
|
|
|
}
|