You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
this is not an issue with the chat but with a custom way to integrate this for my userbase. I have connected the chat to mysql to check for a valid username but I am having trouble to actually launch the chat when providing the user details.
to pass the username and a key to verify a valid user. The console returns the username and id correctly. Now my problem is that I want to auto connect the user to the chat with the given details. So I basically want to remove the option so the user has to enter a username and use my urll provided username to connect him.
Your help would be greatly appreciated. I am more than willng to donate a few bucks to get this working.
My actual code modification is:
app.get("/:username/:id?", (req, res) => {
con.query(
"SELECT * FROM users WHERE username = " +
con.escape(req.params.username) +
" AND token = "+
con.escape(req.params.id),
function (err, result, fields) {
reslen = result.length;
if (reslen == 0){
if (err) throw err;
console.log("Invalid user");
} else {
console.log("Valid user");
// this is the place where I need to connect the username to the chat
}
}
);
});
The mysql connection etc is working fine. It shows in the console if the details were correct or not. I just need a way to actually connect the user to the room with his username. Right now its just stuck loading nothing :)
The text was updated successfully, but these errors were encountered:
Hi there,
this is not an issue with the chat but with a custom way to integrate this for my userbase. I have connected the chat to mysql to check for a valid username but I am having trouble to actually launch the chat when providing the user details.
Here is my solution so far:
I added:
to pass the username and a key to verify a valid user. The console returns the username and id correctly. Now my problem is that I want to auto connect the user to the chat with the given details. So I basically want to remove the option so the user has to enter a username and use my urll provided username to connect him.
Your help would be greatly appreciated. I am more than willng to donate a few bucks to get this working.
My actual code modification is:
The mysql connection etc is working fine. It shows in the console if the details were correct or not. I just need a way to actually connect the user to the room with his username. Right now its just stuck loading nothing :)
The text was updated successfully, but these errors were encountered: