New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to leave chat room #11239
Comments
What version of nodebb? And how do you reproduce? I tried to leave a room that I am not the owner of and it worked fine. caller.uid is either |
v2.8.1 I forgot to add this is through the API. The caller.uid is definitely a string if I typeof the value. Also using Session Sharing plugin if that impacts it |
Can you share how you are calling the api? I want to find out how req.uid is becoming a string. Maybe add a console.log(new Error('a').stack) right before the if check |
The api url is
Stack trace:- Chats.kickUser (\src\controllers\write\chats.js:83:16) |
I meant how are you making the request to the API? via curl or something else etc? |
Through our web app using Master token and ?_uid=XXX for the forum id |
👍🏼 I will take a look, we will probably parseInt the _uid when we get it on our side so we don't have to parseInt all the |
Can you test the above change? |
That works great 👍 |
The below caller.uid needs a parseInt wrapped around it for the equality check to be true otherwise it falls into the else and errors if you arent the owner of the chat room
NodeBB/src/api/chats.js
Lines 112 to 116 in 24e58c2
The text was updated successfully, but these errors were encountered: