lib/octofish.js
function( authType ) {
            switch ( authType.toLowerCase() ) {
                case 'basic':
                    console.log( 'Attempting to use basic authorisation' );
                    getBasicAuth() ? cb_success() : cb_failure();
                    break;

                case 'oauth':
                    console.log( 'Using oAuth to authenticate' );
                    return getOAuth();
                    break;

                default:
                    console.warn( 'Incorrect authorisation type passed to Octofish' );
                    console.warn( 'Authorisation to github will be unauthorised' );

                    cb_failure();
                    return false;
            }

            return true;
        }
function( authType ) {
            switch ( authType.toLowerCase() ) {
                case 'basic':
                    console.log( 'Attempting to use basic authorisation' );
                    getBasicAuth() ? cb_success() : cb_failure();
                    break;

                case 'oauth':
                    console.log( 'Using oAuth to authenticate' );
                    return getOAuth();
                    break;

                default:
                    console.warn( 'Incorrect authorisation type passed to Octofish' );
                    console.warn( 'Authorisation to github will be unauthorised' );

                    cb_failure();
                    return false;
            }

            return true;
        }
function ( authType ) { switch ( authType . toLowerCase ( ) ) { case 'basic' : console . log ( 'Attempting to use basic authorisation' ) ; getBasicAuth ( ) ? cb_success ( ) : cb_failure ( ) ; break ; case 'oauth' : console . log ( 'Using oAuth to authenticate' ) ; return getOAuth ( ) ; break ; default : console . warn ( 'Incorrect authorisation type passed to Octofish' ) ; console . warn ( 'Authorisation to github will be unauthorised' ) ; cb_failure ( ) ; return false ; } return true ; }
Gets the correct method for building an authentication object to pass to github
@param authType { basic || oauth }
@return calls the correct function for building an auth object || null
Gets the correct method for building an authentication object to pass to github