lib/githubAuthentication.js
function getUserCredentials() {
  return new Promise((resolve) => {
    print(clc.bold('Sign in to authorize this app to find open pull-requests'), true);
    gitUser.email((err, email) => {
      prompt.message = '';
      prompt.delimiter = '';
      prompt.start();
      prompt.get({
        properties: {
          username: {
            description: 'Github username',
            default: email,
            message: 'Name must be only letters, spaces, or dashes',
            required: true
          },
          password: {
            description: 'Github password',
            hidden: true
          }
        }
      }, (err, result) => {
        resolve(result);
      });
    });
  });
}
function getUserCredentials() {
  return new Promise((resolve) => {
    print(clc.bold('Sign in to authorize this app to find open pull-requests'), true);
    gitUser.email((err, email) => {
      prompt.message = '';
      prompt.delimiter = '';
      prompt.start();
      prompt.get({
        properties: {
          username: {
            description: 'Github username',
            default: email,
            message: 'Name must be only letters, spaces, or dashes',
            required: true
          },
          password: {
            description: 'Github password',
            hidden: true
          }
        }
      }, (err, result) => {
        resolve(result);
      });
    });
  });
}
function getUserCredentials ( ) { return new Promise ( ( resolve ) => { print ( clc . bold ( 'Sign in to authorize this app to find open pull-requests' ) , true ) ; gitUser . email ( ( err , email ) => { prompt . message = '' ; prompt . delimiter = '' ; prompt . start ( ) ; prompt . get ( { properties : { username : { description : 'Github username' , default : email , message : 'Name must be only letters, spaces, or dashes' , required : true } , password : { description : 'Github password' , hidden : true } } } , ( err , result ) => { resolve ( result ) ; } ) ; } ) ; } ) ; }
Prompts the user to enter their Github login details.
@return {Promise} Resolves to an object containin a username and password
Prompts the user to enter their Github login details .