oro-sdk-apis 5.15.4 → 5.17.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -2,6 +2,7 @@ import { sha256 } from 'hash.js';
2
2
  import { Buffer } from 'buffer/';
3
3
  import createAuthRefreshInterceptor from 'axios-auth-refresh';
4
4
  import axios from 'axios';
5
+ import { v4 } from 'uuid';
5
6
 
6
7
  /**
7
8
  * This function return a base64 string representation of a hashed string
@@ -543,10 +544,13 @@ var APIService = /*#__PURE__*/function (_AxiosService) {
543
544
  _this.tokenRefreshFailureCallback = tokenRefreshFailureCallback;
544
545
  _this.tokens = {};
545
546
  var self = _assertThisInitialized(_this);
547
+ var sessionId = v4();
546
548
  _this.axios.interceptors.request.use(function (config) {
547
549
  var token = config.useRefreshToken ? self.getTokens().refreshToken : self.getTokens().accessToken;
548
550
  config.headers = _extends({}, config.headers, {
549
- Authorization: "Bearer " + token
551
+ Authorization: "Bearer " + token,
552
+ 'X-Session-Id': sessionId,
553
+ 'X-Request-Id': v4()
550
554
  });
551
555
  return config;
552
556
  }, function (error) {