@gandalan/weblibs 1.0.22 → 1.0.23

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 +11 -9
  2. package/package.json +1 -1
package/api/IDAS.js CHANGED
@@ -2,17 +2,19 @@ import { jwtTokenInvalid } from "./authUtils";
2
2
  import { RESTClient } from "./RESTClient";
3
3
  import jwt_decode from 'jwt-decode';
4
4
 
5
- export function IDASFactory(settings = {
6
- appToken : localStorage.getItem("IDAS_AppToken"),
7
- mandantGuid : localStorage.getItem("IDAS_MandantGuid"),
8
- apiBaseurl : localStorage.getItem("IDAS_ApiBaseUrl"),
9
- authUrl : localStorage.getItem("IDAS_ApiBaseUrl"),
10
- jwtRefreshToken : localStorage.getItem("IDAS_AuthJwtRefreshToken"),
11
- jwtCallbackPath : localStorage.getItem("IDAS_AuthJwtCallbackPath")
12
- })
5
+ export function IDASFactory(settings)
13
6
  {
7
+ let defaultSettings = {
8
+ appToken: localStorage.getItem("IDAS_AppToken"),
9
+ mandantGuid: localStorage.getItem("IDAS_MandantGuid"),
10
+ apiBaseurl: localStorage.getItem("IDAS_ApiBaseUrl"),
11
+ authUrl : localStorage.getItem("IDAS_ApiBaseUrl"),
12
+ jwtRefreshToken: localStorage.getItem("IDAS_AuthJwtRefreshToken"),
13
+ jwtCallbackPath: localStorage.getItem("IDAS_AuthJwtCallbackPath"),
14
+ };
15
+ settings = { ...defaultSettings, ...settings };
14
16
  let idas = undefined;
15
- if (!jwtTokenInvalid(settings))
17
+ if (!jwtTokenInvalid(settings))
16
18
  {
17
19
  console.log("init: with JWT token");
18
20
  idas = new IDAS(settings);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gandalan/weblibs",
3
- "version": "1.0.22",
3
+ "version": "1.0.23",
4
4
  "description": "WebLibs for Gandalan JS/TS/Svelte projects",
5
5
  "keywords": [
6
6
  "gandalan"