chatengine-io / react-chat-engine-advanced

Chat Engine's react components done the right way...
MIT License
18 stars 11 forks source link

react chat engine advanced admin user auto changing #207

Open QMHLO opened 1 year ago

QMHLO commented 1 year ago

here is the problem. In the chat engine, my admin username is the seller. Created a new user. The new user's email is user9818@gmail.com. When I registered for this email user, the admin user was automatically changed.

function getorCreateChat(callback) {
    axios
        .put(
            "https://api.chatengine.io/chats/", {
                usernames: ["seller", username || localStorage.getItem("email")],
                title: "Chatting",
                is_direct_chat: true,
            }, {
                headers: {
                    "PRIVATE-KEY": process.env.REACT_APP_PRIVATE_KEY
                }
            }
        )
        .then((r) => callback(r.data));
}