diff options
| author | JP Dillingham <jpdillingham@gmail.com> | 2021-10-03 11:52:43 -0500 |
|---|---|---|
| committer | JP Dillingham <jpdillingham@gmail.com> | 2021-10-03 11:52:43 -0500 |
| commit | 32a9a0f21e93cb0e172c00f0864a17b74d3dfa3b (patch) | |
| tree | 82b118a2ee1fc35a012077f9484c29bd59bd1778 /src | |
| parent | 05760ef168e5e25a13de9e7065405a78e5739ece (diff) | |
| download | slskd-32a9a0f21e93cb0e172c00f0864a17b74d3dfa3b.tar.gz | |
extend hubFactory
Diffstat (limited to 'src')
| -rw-r--r-- | src/web/src/lib/hubFactory.js | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/web/src/lib/hubFactory.js b/src/web/src/lib/hubFactory.js index f03d89a0..0fead578 100644 --- a/src/web/src/lib/hubFactory.js +++ b/src/web/src/lib/hubFactory.js @@ -7,12 +7,14 @@ import { import { rootUrl } from '../config'; import * as session from '../lib/session'; -export const createApplicationHubConnection = () => +export const createHubConnection = ({ url }) => new HubConnectionBuilder() - .withUrl(`${rootUrl}/hub/application`, { + .withUrl(url, { accessTokenFactory: session.getToken }) .withAutomaticReconnect() .withHubProtocol(new JsonHubProtocol()) .configureLogging(LogLevel.Information) - .build();
\ No newline at end of file + .build(); + +export const createApplicationHubConnection = () => createHubConnection({ url: `${rootUrl}/hub/application` });
\ No newline at end of file |
