lib/twitch.auth.js
function updateSession(callback) {
  core.api({method: ''}, function(err, response) {
    var session;
    if (err) {
      core.log('error encountered updating session:', err);
      callback && callback(err, null);
      return;
    }

    if (!response.token.valid) {
      // Invalid token. Either it has expired or the user has
      // revoked permission, so clear out our stored data.
      logout(callback);
      return;
    }

    callback && callback(null, session);
  });
}
function updateSession(callback) {
  core.api({method: ''}, function(err, response) {
    var session;
    if (err) {
      core.log('error encountered updating session:', err);
      callback && callback(err, null);
      return;
    }

    if (!response.token.valid) {
      // Invalid token. Either it has expired or the user has
      // revoked permission, so clear out our stored data.
      logout(callback);
      return;
    }

    callback && callback(null, session);
  });
}
function updateSession ( callback ) { core . api ( { method : '' } , function ( err , response ) { var session ; if ( err ) { core . log ( 'error encountered updating session:' , err ) ; callback && callback ( err , null ) ; return ; } if ( ! response . token . valid ) { // Invalid token. Either it has expired or the user has // revoked permission, so clear out our stored data. logout ( callback ) ; return ; } callback && callback ( null , session ) ; } ) ; }
Updates session info from the API.

@private @method updateSession
Updates session info from the API .