aboutsummaryrefslogtreecommitdiffstats
path: root/src/web
diff options
context:
space:
mode:
authorJP Dillingham <jpdillingham@gmail.com>2022-03-01 16:13:00 -0600
committerJP Dillingham <jpdillingham@gmail.com>2022-03-01 16:13:00 -0600
commit212e356fcb1cf431eb82a111e0dd6b8f9cbaaa52 (patch)
treee1f8628fbf4e0f49d49fe4c7e5d60ed01a59c3ed /src/web
parentb16f069206a05ffdb696a886b2f9c887ee68f836 (diff)
downloadslskd-212e356fcb1cf431eb82a111e0dd6b8f9cbaaa52.tar.gz
pass credentials when auth is disabled
Diffstat (limited to 'src/web')
-rw-r--r--src/web/src/lib/api.js4
-rw-r--r--src/web/src/lib/hubFactory.js3
2 files changed, 4 insertions, 3 deletions
diff --git a/src/web/src/lib/api.js b/src/web/src/lib/api.js
index 9a62ed33..73e75373 100644
--- a/src/web/src/lib/api.js
+++ b/src/web/src/lib/api.js
@@ -1,5 +1,5 @@
import axios from 'axios';
-import { baseUrl, tokenPassthroughValue } from '../config';
+import { baseUrl } from '../config';
import * as session from './session';
axios.defaults.baseURL = baseUrl;
@@ -13,7 +13,7 @@ api.interceptors.request.use(config => {
config.headers['Content-Type'] = 'application/json';
- if (token && token !== tokenPassthroughValue) {
+ if (!session.isPassthroughEnabled() && token) {
config.headers.Authorization = 'Bearer ' + token;
}
diff --git a/src/web/src/lib/hubFactory.js b/src/web/src/lib/hubFactory.js
index 8ccd62ff..a64c5c40 100644
--- a/src/web/src/lib/hubFactory.js
+++ b/src/web/src/lib/hubFactory.js
@@ -10,7 +10,8 @@ import * as session from '../lib/session';
export const createHubConnection = ({ url }) =>
new HubConnectionBuilder()
.withUrl(url, {
- accessTokenFactory: session.getToken
+ withCredentials: true,
+ accessTokenFactory: session.isPassthroughEnabled() ? undefined : session.getToken
})
.withAutomaticReconnect([0, 500, 1000, 3000, 5000, 5000, 5000, 5000, 5000])
.withHubProtocol(new JsonHubProtocol())