Skip to content

Commit 5835023

Browse files
authored
fix(frontend): socket connection path [CM-824] (#3685)
1 parent 615106b commit 5835023

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

frontend/src/modules/auth/auth.socket.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,16 @@ export const connectSocket = (token) => {
3030
socketIoClient.disconnect();
3131
}
3232

33-
const path = config.env === 'production' || config.env === 'staging'
34-
? '/api/socket.io'
35-
: '/socket.io';
33+
const getSocketPath = () => {
34+
const { env } = config;
35+
const path = env === 'production' || env === 'staging' ? '/api/socket.io' : '/socket.io';
36+
console.info(`Socket.IO connecting to: ${path}`);
37+
38+
return path;
39+
};
3640

3741
socketIoClient = io(`${config.websocketsUrl}/user`, {
38-
path,
42+
path: getSocketPath(),
3943
query: {
4044
token,
4145
},

0 commit comments

Comments
 (0)