Project

General

Profile

1
import {COOKIE} from '../../login/utils/helper.class';
2
import {HttpHeaders} from "@angular/common/http";
3

    
4

    
5
export class CustomOptions {
6
  
7
  public static registryOptions(): {} {
8
      return {
9
        headers: new HttpHeaders({
10
          'Content-Type': 'application/json',
11
        }), withCredentials: true
12
      };
13
    }
14

    
15
  public static getAuthOptionsWithBody():{} {
16
    return {
17
      headers: new HttpHeaders({
18
        'Content-Type': 'application/json',
19
        'X-XSRF-TOKEN': COOKIE.getCookie(COOKIE.cookieName_id)?COOKIE.getCookie(COOKIE.cookieName_id):''
20
      }), withCredentials: true
21
    };
22
  }
23

    
24
  public static getAuthOptions():{} {
25
    const httpOptions = {
26
      headers: new HttpHeaders({
27
        'X-XSRF-TOKEN': (COOKIE.getCookie(COOKIE.cookieName_id))?COOKIE.getCookie(COOKIE.cookieName_id):''
28
      }), withCredentials: true
29
    };
30
    return httpOptions;
31
  }
32

    
33
}
(1-1/2)