diff options
Diffstat (limited to 'src/web')
| -rw-r--r-- | src/web/src/components/App.jsx | 3 | ||||
| -rw-r--r-- | src/web/src/lib/hubFactory.js | 6 |
2 files changed, 4 insertions, 5 deletions
diff --git a/src/web/src/components/App.jsx b/src/web/src/components/App.jsx index 83997b20..bbd7bd91 100644 --- a/src/web/src/components/App.jsx +++ b/src/web/src/components/App.jsx @@ -5,6 +5,7 @@ import { createApplicationHubConnection } from '../lib/hubFactory'; import * as relayAPI from '../lib/relay'; import { connect, disconnect } from '../lib/server'; import * as session from '../lib/session'; +import { isPassthroughEnabled } from '../lib/token'; import AppContext from './AppContext'; import Browse from './Browse/Browse'; import Chat from './Chat/Chat'; @@ -282,7 +283,7 @@ class App extends Component { ); } - if (!session.isLoggedIn() && !session.isPassthroughEnabled()) { + if (!session.isLoggedIn() && !isPassthroughEnabled()) { return ( <LoginForm error={login.error} diff --git a/src/web/src/lib/hubFactory.js b/src/web/src/lib/hubFactory.js index b764ed4a..d5264e03 100644 --- a/src/web/src/lib/hubFactory.js +++ b/src/web/src/lib/hubFactory.js @@ -1,5 +1,5 @@ import { hubBaseUrl } from '../config'; -import * as session from './session'; +import { getToken, isPassthroughEnabled } from './token'; import { HubConnectionBuilder, JsonHubProtocol, @@ -9,9 +9,7 @@ import { export const createHubConnection = ({ url }) => new HubConnectionBuilder() .withUrl(url, { - accessTokenFactory: session.isPassthroughEnabled() - ? undefined - : session.getToken, + accessTokenFactory: isPassthroughEnabled() ? undefined : getToken, withCredentials: true, }) .withAutomaticReconnect([ |
