@gandalan/weblibs 0.0.13 → 0.0.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.
Files changed (2) hide show
  1. package/api/IDAS.js +8 -4
  2. package/package.json +1 -1
package/api/IDAS.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { RESTClient } from "./RESTClient";
2
2
 
3
- if (window.location.search) {
3
+ /*if (window.location.search) {
4
4
  var urlParams = new URLSearchParams(location.search);
5
5
  if (urlParams.has("t"))
6
6
  localStorage.setItem("IDAS_AuthToken", urlParams.get("t"));
@@ -9,14 +9,18 @@ if (window.location.search) {
9
9
  if (urlParams.has("a"))
10
10
  localStorage.setItem("IDAS_ApiBaseUrl", urlParams.get("a"));
11
11
  window.location = window.location.origin;
12
- }
12
+ }*/
13
13
 
14
14
  let appToken = localStorage.getItem("IDAS_AppToken") || "66B70E0B-F7C4-4829-B12A-18AD309E3970";
15
15
  let authToken = localStorage.getItem("IDAS_AuthToken");
16
16
  //let mandantGuid = localStorage.getItem("IDAS_MandantGuid");
17
- let apiBaseUrl = localStorage.getItem("IDAS_ApiBaseUrl") || "https://api.dev.idas-cloudservices.net/api";
17
+ let apiBaseUrl = localStorage.getItem("IDAS_ApiBaseUrl") || "https://api.dev.idas-cloudservices.net/api/";
18
18
  //let siteBaseUrl = localStorage.getItem("SiteBaseUrl") || window.location.protocol + "//" + window.location.host;
19
- let ssoAuthUrl = apiBaseUrl.replace(/\/api$/, "") + "/SSO?a=" + appToken + "&r=%target%?t=%token%%26m=%mandant%";
19
+
20
+ let ssoAuthUrl = apiBaseUrl + "/SSO?a=" + appToken + "&r=%target%%3Ft=%token%%26m=%mandant%";
21
+ ssoAuthUrl = ssoAuthUrl.replace('/api/', '/');
22
+ ssoAuthUrl = ssoAuthUrl.replace('//', '/');
23
+
20
24
  let restClient = new RESTClient(apiBaseUrl, authToken);
21
25
  restClient.onError = (error, message) => {
22
26
  if (message.indexOf("401") || message.indexOf("403"))
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gandalan/weblibs",
3
- "version": "0.0.13",
3
+ "version": "0.0.16",
4
4
  "description": "WebLibs for Gandalan JS/TS/Svelte projects",
5
5
  "author": "Philipp Reif",
6
6
  "license": "ISC",