aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-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())