lib/twitch.auth.js
function initSession(storedSession, callback) {
  if (typeof storedSession === "function") {
    callback = storedSession;
  }

  core.setSession((storedSession && makeSession(storedSession)) || {});

  getStatus({ force: true }, function(err, status) {
    if (status.authenticated) {
      core.events.emit('auth.login', status);
    }

    if (typeof callback === "function") {
      callback(err, status);
    }
  });
}
function initSession(storedSession, callback) {
  if (typeof storedSession === "function") {
    callback = storedSession;
  }

  core.setSession((storedSession && makeSession(storedSession)) || {});

  getStatus({ force: true }, function(err, status) {
    if (status.authenticated) {
      core.events.emit('auth.login', status);
    }

    if (typeof callback === "function") {
      callback(err, status);
    }
  });
}
function initSession ( storedSession , callback ) { if ( typeof storedSession === "function" ) { callback = storedSession ; } core . setSession ( ( storedSession && makeSession ( storedSession ) ) || { } ) ; getStatus ( { force : true } , function ( err , status ) { if ( status . authenticated ) { core . events . emit ( 'auth.login' , status ) ; } if ( typeof callback === "function" ) { callback ( err , status ) ; } } ) ; }
Sets session to a stored one.

@private
@method initSession
@param {Object} storedSession
@param {Function} [callback]
Sets session to a stored one .