2019-06-03 15:20:36 +02:00
|
|
|
import {COOKIE} from '../../login/utils/helper.class';
|
|
|
|
import {HttpHeaders} from "@angular/common/http";
|
2017-12-19 13:53:46 +01:00
|
|
|
|
|
|
|
|
2019-03-18 13:58:02 +01:00
|
|
|
export class CustomOptions {
|
2020-08-06 13:50:08 +02:00
|
|
|
|
|
|
|
public static registryOptions(): any {
|
|
|
|
return {
|
|
|
|
headers: new HttpHeaders({
|
|
|
|
'Content-Type': 'application/json',
|
|
|
|
}), withCredentials: true
|
|
|
|
};
|
|
|
|
}
|
2019-03-18 13:58:02 +01:00
|
|
|
|
2019-06-03 15:20:36 +02:00
|
|
|
public static getAuthOptionsWithBody():{} {
|
|
|
|
return {
|
|
|
|
headers: new HttpHeaders({
|
|
|
|
'Content-Type': 'application/json',
|
2020-08-07 12:27:50 +02:00
|
|
|
'X-XSRF-TOKEN': COOKIE.getCookie(COOKIE.cookieName_id)?COOKIE.getCookie(COOKIE.cookieName_id):''
|
2019-06-03 15:20:36 +02:00
|
|
|
}), withCredentials: true
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2020-09-24 13:18:24 +02:00
|
|
|
public static getAuthOptions():{} {
|
2019-06-03 15:20:36 +02:00
|
|
|
const httpOptions = {
|
|
|
|
headers: new HttpHeaders({
|
2020-08-07 12:27:50 +02:00
|
|
|
'X-XSRF-TOKEN': (COOKIE.getCookie(COOKIE.cookieName_id))?COOKIE.getCookie(COOKIE.cookieName_id):''
|
2019-06-03 15:20:36 +02:00
|
|
|
}), withCredentials: true
|
|
|
|
};
|
|
|
|
return httpOptions;
|
|
|
|
}
|
2019-03-18 13:58:02 +01:00
|
|
|
|
2017-12-19 13:53:46 +01:00
|
|
|
}
|