We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 615106b commit 5835023Copy full SHA for 5835023
1 file changed
frontend/src/modules/auth/auth.socket.ts
@@ -30,12 +30,16 @@ export const connectSocket = (token) => {
30
socketIoClient.disconnect();
31
}
32
33
- const path = config.env === 'production' || config.env === 'staging'
34
- ? '/api/socket.io'
35
- : '/socket.io';
+ const getSocketPath = () => {
+ const { env } = config;
+ const path = env === 'production' || env === 'staging' ? '/api/socket.io' : '/socket.io';
36
+ console.info(`Socket.IO connecting to: ${path}`);
37
+
38
+ return path;
39
+ };
40
41
socketIoClient = io(`${config.websocketsUrl}/user`, {
- path,
42
+ path: getSocketPath(),
43
query: {
44
token,
45
},
0 commit comments