简体   繁体   中英

automatically log in with converse.js

I'm trying to modify the Converse.js client to automatically bind an anonymous user to a moderator without login. If the client pops up, the user shouldn't get a login prompt but automatically connect to a logged in moderator.

You can try the auto_login configuration setting, possibly together with the credentials_url setting, so that the JID and password of the moderator are fetched automatically by converse.js.

For example, you'll then initialize converse.js like this:

converse.initialize({
    'allow_logout': false,
    'auto_login': 'true',
    'auto_reconnect': true,
    'bosh_service_url': 'https://bosh.example.org',
    'credentials_url': 'https://example.org/credentials'
});

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM