Comments (10)
Hi Brandon, why do you set prebind=true? What are you trying to do?
Did you read the relevant part in the docs?
http://conversejs.org/docs/html/index.html#pre-binding-and-single-session-support
from converse.js.
Hi jcbrand,
I have read the link you gave us and I'm having the same problem too. Basically what I'm trying to achieve is the single sign-on from the user's perspective, i.e. once they sign on our site, they don't have to sign on the XMPP server again. So in the Rails backend, I do the pre-bind for the user, obtain the corresponding jid, sid, and rid and pass them to the javascript.
In the javascript (main.js), I have:
require(["jquery", "converse"], function($, converse) {
console.log(gon.jabber_id)
console.log(gon.jabber_sid)
console.log(gon.jabber_rid)
converse.initialize({
auto_list_rooms: false,
auto_subscribe: false,
bosh_service_url: gon.xmpp_bosh_service_url,
hide_muc_server: false,
i18n: locales.en, // Refer to ./locale/locales.js to see which locales are supported
prebind: true,
show_controlbox_by_default: true,
xhr_user_search: false
});
var connection = new Strophe.Connection(gon.xmpp_bosh_service_url);
connection.attach(gon.jabber_id, gon.jabber_sid, gon.jabber_rid, function (status) {
if ((status === Strophe.Status.ATTACHED) || (status === Strophe.Status.CONNECTED)) {
converse.onConnected(connection)
}
});
});
The javascript console shows I have got the right IDs, i.e.
[email protected]
0da01f6073c514cd7fbb4dc322820e6df6219fec
7268
and then it complains "TypeError: converse.rosterview is undefined" at line 675:
this.$el.append(converse.rosterview.$el);
Is there anything we haven't done it correctly? Please kindly advise. Thank you so much!
Calvin
from converse.js.
I didn't include the resource name in the JID "[email protected]" and thought that was causing the problem. But even with JID having the resource name, e.g. [email protected]/laptop, I got the same error... 8-(
from converse.js.
I spent days in this issue but still can't make it work- actually I'm not sure if this is the issue from conversejs. It could possibly the issue from strophejs. For now I have to work around it (with code changes) by passing the user's jid and password to conversejs and if it exists, it will automatically login. This works for me because my application is single page application and doesn't have multiple page flow.
from converse.js.
Had the same issue. Fixed it by show_controlbox_by_default: false
inside converse.initialize({})
. Now there are no any errors in console.
My JS code:
require(["jquery", "converse"], function($, converse) {
converse.initialize({
auto_list_rooms: false,
auto_subscribe: false,
bosh_service_url: '',
hide_muc_server: true,
i18n: locales.en,
prebind: true,
show_controlbox_by_default: false, /*prebind:true + show_control_...:true = errors*/
xhr_user_search: false,
fullname: '{{.user.Fullname}}'
});
$.getJSON('/prebind', function (data) {
var connection = new Strophe.Connection(data.BoshServer);
connection.attach(data.JID, data.SID, data.RID, function (status) {
if ((status === Strophe.Status.ATTACHED) || (status === Strophe.Status.CONNECTED))
converse.onConnected(connection)
});
});
});
from converse.js.
I'm also facing the exact same error when I set prebind=true.
from converse.js.
Hi @calvinchso and @vdurbha, sorry this thread seems to have passed my by!
Can you please check whether any of these errors still occur in the newest release?
https://github.com/jcbrand/converse.js/releases/tag/v0.5.1
from converse.js.
Hi jcbrand,
Sorry I no longer have the code base to try that out. Hopefully others in this thread can share the results. Thanks for the reply anyway!
from converse.js.
Can anyone give me the example of the HTML file which can pass the username and password to the converse.js and it will automatically login.. This is really urgent..
Regards
bhargav L Pandya
from converse.js.
Just for notice (at least in newest version). Just spent some time to fix same error message on 0.7.4 and also have prebind = true.
If prebind is set true, also jid, sid, rid and bosh_service_url MUST be set in configuration parameters.
Otherwise converse.onConnected() wont be called. converse.onConnected() initialize quite a lot of things (like roster).
from converse.js.
Related Issues (20)
- Unable to open the newly created room after user login success HOT 2
- Input hangs, no messages visible HOT 2
- Converse.js fails if passwords contain an & HOT 1
- Prune history under heavy flooding does never happen HOT 1
- MUC Sidebar optimization in case of massive room joins.
- Disable autocomplete / search for public rooms HOT 2
- CSS issue with 'outline-color': inconsistent behaviour between browsers HOT 4
- Trouble with keepalive and prebind when open new browser tab and/or window HOT 1
- Error getting data from Vcard Contact HOT 2
- New release build? HOT 4
- Multi-line nested quotes display incorrectly HOT 6
- Save draft messages when switching channels HOT 1
- beforeMessageBodyTransformed plugin hooks (and others) are not respecting async/await HOT 1
- Can't access lexical declaration 'init_settings' before initialization HOT 4
- Do not create empty nick element in bookmarks HOT 1
- I18N problem
- Converse 10.1.7 and Webpack conflict
- audio player accessibility HOT 3
- Registration form is not fetched in latest version 10.1.7 HOT 1
- Cannot blacklist modules when in dev.html
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from converse.js.