bx-rest 0.0.23 → 0.0.24

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -664,6 +664,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
664
664
  }]
665
665
  }] });
666
666
 
667
+ const REST_SETTINGS = {
668
+ support: {
669
+ map: true,
670
+ result: true
671
+ },
672
+ auth: 'cookies'
673
+ };
674
+
667
675
  class RestServices {
668
676
  constructor() {
669
677
  this.BX24 = false;
@@ -832,11 +840,12 @@ class SessionKeyServices extends BaseServices {
832
840
  return false;
833
841
  }
834
842
  getAuthParams() {
835
- // if (env.production && !env.component) {
836
- return this.authData$.pipe(take(1), map(v => (v) ? v.access_token : undefined));
837
- // } else {
838
- // return of(this.getAuth())
839
- // }
843
+ switch (REST_SETTINGS.auth) {
844
+ case 'cookies':
845
+ return of(this.getAuth());
846
+ default:
847
+ return this.authData$.pipe(take(1), map(v => (v) ? v.access_token : undefined));
848
+ }
840
849
  }
841
850
  getBaseUrl() {
842
851
  return this.authData$.pipe(map(v => (v && v.domain) ? this.prepareBaseAddress(v.domain, 'b24.trace-studio.com') : undefined));