@sedoo/unidoo 0.1.12 → 0.1.14

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/index.js CHANGED
@@ -4,5 +4,5 @@ const Unidoo = plugin;
4
4
  export default Unidoo;
5
5
 
6
6
  // Enables "cherry pick" imports (e.g: import { Unidoo, UnidooKeycloak } from "@sedoo/unidoo")
7
- export { default as Unidoo} from "./src/plugin";
8
- export { default as UnidooKeycloak} from "./src/auth";
7
+ export { default as Unidoo } from "./src/plugin";
8
+ export { default as UnidooKeycloak } from "./src/auth";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sedoo/unidoo",
3
- "version": "0.1.12",
3
+ "version": "0.1.14",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "build": "npm run build:unidoo && npm run build:auth",
package/src/auth.js CHANGED
@@ -1,11 +1,13 @@
1
1
  import { isEmpty } from "lodash";
2
- import Keycloak from "keycloak-js";
3
2
 
4
3
  const UnidooKeycloak = {
5
4
  install(Vue, { axios }) {
6
5
  if (this.installed) return;
7
6
  this.installed = true;
8
7
 
8
+ const Keycloak =
9
+ typeof window !== "undefined" ? require("keycloak-js") : null;
10
+
9
11
  /**
10
12
  * Init keycloak with SSO parameters
11
13
  * @param {*} options SSO parameters
@@ -35,6 +37,9 @@ const UnidooKeycloak = {
35
37
  keycloak.token
36
38
  );
37
39
  updateSSoToken(keycloak);
40
+ })
41
+ .catch((err) => {
42
+ throw new Error(err);
38
43
  });
39
44
  };
40
45
  }