javascript - cannot get chat dialogs with backend authonticatioin "Forbidden. Need user." errror -


i using js sdk quickblox. create session on backend server:

https://api.quickblox.com/session.json token result in js

qb.init(token, apiid); qb.getsession(function(err, res) {     qb.chat.connect({userid: user.id, password: user.pass}, function(err, roster) {         qb.chat.dialog.list(null, function(err, resdialogs) {});     }); }); 

and have "forbidden. need user" error. thinking b.chat.connect should set current user, seems wrong.

i added db.login , works right now.

qb.login({login: user.login, password: user.pass}, function(err, res) {     qb.getsession(function (err, res) {         qb.chat.connect({userid: user.id, password: user.pass}, function (err, roster) {             qb.chat.dialog.list(null, function (err, resdialogs) {             });         });     }); }); 

Comments

Popular posts from this blog

java - Jasper subreport showing only one entry from the JSON data source when embedded in the Title band -

serialization - Convert Any type in scala to Array[Byte] and back -

SonarQube Plugin for Jenkins does not find SonarQube Scanner executable -