@sedoo/unidoo 0.1.14 → 0.1.16

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sedoo/unidoo",
3
- "version": "0.1.14",
3
+ "version": "0.1.16",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "build": "npm run build:unidoo && npm run build:auth",
package/src/auth.js CHANGED
@@ -34,7 +34,7 @@ const UnidooKeycloak = {
34
34
  interceptRequests(
35
35
  axios,
36
36
  defaultOptions.ssoParams.authorizedDomains,
37
- keycloak.token
37
+ keycloak
38
38
  );
39
39
  updateSSoToken(keycloak);
40
40
  })
@@ -74,19 +74,19 @@ function handleErrors(options) {
74
74
 
75
75
  function updateSSoToken(keycloak) {
76
76
  setTimeout(function() {
77
- keycloak.updateToken(200000);
77
+ keycloak.updateToken(200000).catch(_ => null);
78
78
  updateSSoToken(keycloak);
79
79
  }, 200000);
80
80
  }
81
81
 
82
- function interceptRequests(axios, authorizedDomains, token) {
82
+ function interceptRequests(axios, authorizedDomains, keycloak) {
83
83
  axios.interceptors.request.use(
84
84
  (config) => {
85
85
  if (
86
86
  authorizedDomains.some((url) => config.url.startsWith(url)) &&
87
- token
87
+ keycloak.token
88
88
  ) {
89
- config.headers.Authorization = "Bearer " + token;
89
+ config.headers.Authorization = "Bearer " + keycloak.token;
90
90
  config.headers.Accept = "application/json, text/plain, */*";
91
91
  }
92
92
  return config;