feature/IO-3357-Reynolds-and-Reynolds-DMS-API-Integration -Cleaned up DMS key check (consolidated into a helper function), Clean up DMS post form and make it agnostic, same with customer selector.
This commit is contained in:
16
client/src/utils/legacySocket.js
Normal file
16
client/src/utils/legacySocket.js
Normal file
@@ -0,0 +1,16 @@
|
||||
// client/src/utils/legacySocket.js
|
||||
import SocketIO from "socket.io-client";
|
||||
import { auth } from "../firebase/firebase.utils";
|
||||
|
||||
// Create once, reuse everywhere.
|
||||
const legacySocket = SocketIO(import.meta.env.PROD ? import.meta.env.VITE_APP_AXIOS_BASE_API_URL : "", {
|
||||
path: "/ws",
|
||||
withCredentials: true,
|
||||
autoConnect: false,
|
||||
auth: async (callback) => {
|
||||
const token = auth.currentUser && (await auth.currentUser.getIdToken());
|
||||
callback({ token });
|
||||
}
|
||||
});
|
||||
|
||||
export default legacySocket;
|
||||
Reference in New Issue
Block a user