twilio / twilio-chat-demo-js

Programmable Chat API Demo Application for JavaScript
BSD 3-Clause "New" or "Revised" License
90 stars 94 forks source link

error in gettoken #21

Closed Reena-Patel closed 6 years ago

Reena-Patel commented 7 years ago
function logIn(identity, displayName) {
  fingerprint.get(function(endpointId) {
    request('/getToken?identity=' + identity + '&endpointId=' + endpointId, function(err, res) {
      if (err) { throw new Error(res.text); }

      var token = res.text;

      userContext.identity = identity;
      userContext.endpoint = endpointId;

      $('#login').hide();
      $('#overlay').hide();

      client = new Twilio.Chat.Client(token, { logLevel: 'debug' });

      accessManager = new Twilio.AccessManager(token);
      accessManager.on('tokenUpdated', am => client.updateToken(am.token));
      accessManager.on('tokenExpired', () => {
        request('/getToken?identity=' + identity + '&endpointId=' + endpointId, function(err, res) {
          if (err) {
            console.error('Failed to get a token ', res.text);
            throw new Error(res.text);
          }
          console.log('Got new token!', res.text);
          accessManager.updateToken(res.text);
        });
      })

gives error when fire the request for get token 404 http://localhost:63996/getToken?identity=dgdfh&endpointId=b7e41ae4174a565e2b2c859f04d9b924

philnash commented 6 years ago

Hey, I know this was opened a long time ago, and I'm sorry that we didn't get to you.

Did you fix this error? Have you updated to the latest version of the repo?

I'm going to close this for now, but if you are still facing this, please open it up and let me know what's going on.