lib/client.js
function tryLogin(authInfo, cb) {
  /**
    * Logging?
    * @type {boolean}
    */
  var loggingIn = true;
  request({
    method: 'POST',
    uri: '/login/username',
    headers: {
      'X-Tidal-Token': authInfo.token
    },
    form: {
      username: authInfo.username,
      password: authInfo.password,
      clientUniqueKey: "vjknfvjbnjhbgjhbbg"
    }
  }, function(err, res, data) {
    if(!err){
      if (data && res && res.statusCode !== 200 || err) {
        throw new Error(data)
      }
      data = JSON.parse(data);
      _sessionID = data.sessionId;
      _userID = data.userId;
      _countryCode = data.countryCode;
      _streamQuality = authInfo.quality;
      loggingIn = false;
      loggedIn = true;
      if (cb) {
        cb();
      }
    }
  });
}
function tryLogin(authInfo, cb) {
  /**
    * Logging?
    * @type {boolean}
    */
  var loggingIn = true;
  request({
    method: 'POST',
    uri: '/login/username',
    headers: {
      'X-Tidal-Token': authInfo.token
    },
    form: {
      username: authInfo.username,
      password: authInfo.password,
      clientUniqueKey: "vjknfvjbnjhbgjhbbg"
    }
  }, function(err, res, data) {
    if(!err){
      if (data && res && res.statusCode !== 200 || err) {
        throw new Error(data)
      }
      data = JSON.parse(data);
      _sessionID = data.sessionId;
      _userID = data.userId;
      _countryCode = data.countryCode;
      _streamQuality = authInfo.quality;
      loggingIn = false;
      loggedIn = true;
      if (cb) {
        cb();
      }
    }
  });
}
function tryLogin ( authInfo , cb ) { /**
    * Logging?
    * @type {boolean}
    */ var loggingIn = true ; request ( { method : 'POST' , uri : '/login/username' , headers : { 'X-Tidal-Token' : authInfo . token } , form : { username : authInfo . username , password : authInfo . password , clientUniqueKey : "vjknfvjbnjhbgjhbbg" } } , function ( err , res , data ) { if ( ! err ) { if ( data && res && res . statusCode !== 200 || err ) { throw new Error ( data ) } data = JSON . parse ( data ) ; _sessionID = data . sessionId ; _userID = data . userId ; _countryCode = data . countryCode ; _streamQuality = authInfo . quality ; loggingIn = false ; loggedIn = true ; if ( cb ) { cb ( ) ; } } } ) ; }
Try login using credentials.
@param {{username: String, password: String}}
Try login using credentials .