@dative-gpi/foundation-shared-services 1.1.32 → 1.1.33-socket2

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
@@ -4,7 +4,7 @@
4
4
  "url": "https://github.com/Dative-GPI/foundation-shared-ui.git"
5
5
  },
6
6
  "sideEffects": false,
7
- "version": "1.1.32",
7
+ "version": "1.1.33-socket2",
8
8
  "description": "",
9
9
  "publishConfig": {
10
10
  "access": "public"
@@ -13,7 +13,7 @@
13
13
  "author": "",
14
14
  "license": "ISC",
15
15
  "dependencies": {
16
- "@dative-gpi/foundation-shared-domain": "1.1.32",
16
+ "@dative-gpi/foundation-shared-domain": "1.1.33-socket2",
17
17
  "@vueuse/core": "^14.0.0"
18
18
  },
19
19
  "peerDependencies": {
@@ -22,5 +22,5 @@
22
22
  "vue": "3.5.26",
23
23
  "vue-router": "^4.3.0"
24
24
  },
25
- "gitHead": "a9228a0c02df1ca2b91b60638206c5dc68273a33"
25
+ "gitHead": "d55a7b269e96b94d5c62d1577795cab21db0e031"
26
26
  }
@@ -1,6 +1,8 @@
1
1
  import { computed, onUnmounted, ref, watch } from "vue";
2
2
  import * as signalR from "@microsoft/signalr";
3
3
 
4
+ import { useAppAuthToken } from "../composables/app/useAppAuthToken";
5
+
4
6
  export class HubFactory {
5
7
  static create(
6
8
  url: string | (() => string),
@@ -14,10 +16,14 @@ export class HubFactory {
14
16
  const watcheds = ref<string[]>([]);
15
17
 
16
18
  return () => {
19
+ const { authToken } = useAppAuthToken();
20
+
17
21
  const connect = async () => {
18
22
  if (!connection) {
19
23
  connection = new signalR.HubConnectionBuilder()
20
- .withUrl(typeof url == "string" ? url : url())
24
+ .withUrl(typeof url == "string" ? url : url(), {
25
+ accessTokenFactory: () => authToken.value ?? ""
26
+ })
21
27
  .configureLogging(signalR.LogLevel.Warning)
22
28
  .withAutomaticReconnect()
23
29
  .build();