converse.js注销和登录不会调用凭据_URL

时间:2019-10-26 15:55:48

标签: javascript xmpp converse.js

converse.js有问题。注销后,以新用户身份登录,从不会调用凭据_URL。 我希望可以调用certificate_url来获取新用户的新ID。

我将台式机版本与浏览器Chrome一起使用,Converse.js版本-3.3.4

我创建了一个插件来注销:。

converse.plugins.add('myplugin', {
          initialize: function () {
            const _converse = this._converse;
            _converse.api.listen.on('connected', function () {
              console.log('conectado')
            });
            $('#logout-chat').on('click', function () {
              _converse.api.user.logout();
              _converse.api.connection.disconnect();
            });
          }
        });

我有一个html按钮:

<button id="logout-chat">Logout</button>

单击按钮后,相反将执行注销,并加载我的网站的登录页面。 用新用户登录后,我重新加载了聊天会话页面,但是从没有再次调用凭据_url,并且在注销之前,conversejs使用旧的初始“ jid”。

这是我的初始化:

converse.initialize({
          locales_url: "converse.js-3.3.4/locale/pt_BR/LC_MESSAGES/converse.json",
          i18n: 'pt_BR',
          play_sounds: true,
          notification_icon: 'converse.js-3.3.4/logo/conversejs-filled.svg',
          sounds_path: 'converse.js-3.3.4/sounds/',
          allow_registration: false,
          allow_muc: true,
          singleton: false,
          debug: false,
          visible_toolbar_buttons: {
            call: false,
            spoiler: false,
            emoji: false,
            toggle_occupants: true
          },
          whitelisted_plugins: [
            'myplugin'
          ],

          auto_reconnect: true,
          muc_nickname_from_jid: false,
          allow_logout: true, // No point in logging out when we have auto_login as true.
          allow_muc_invitations: false, // Doesn't make sense to allow because only roster contacts can be invited
          allow_contact_requests: false, 
          authentication: 'login',
          auto_login: true,
          auto_join_rooms: [
            { 'jid': vbosh.gestan_room, 'nick': nickname, 'minimized': true }
          ],
          notify_all_room_messages: false,
          bosh_service_url: vbosh.bosh_service,
          credentials_url: '/GetCredenciais?opcao=credenciais',
          keepalive: true,
          hide_muc_server: false, // Federation is disabled, so no use in showing the MUC server.
          play_sounds: true,
          strict_plugin_dependencies: false,
        });

0 个答案:

没有答案