function checkState() {
    var success = function success(msg, status, jqXHR) {
        if (msg.auth == 'true') {
            if (msg.hasKey == 'true') {
                // Lets see if they've already provided a key
                if (getCookie('stored_key') !== '') {
                    divState('jenkins-hosts');
                    // User has a key and it's been stored so lets allow them access to jenkins api
                } else {
                    // The user has a key so but has not set it so display page to set the key
                    divState('provide');
                }
            } else {
                // The user has to set a secret key. Show page to set key
                divState('set');
            }
        }
    };
    consoleAjaxCmd('GET', '/session/validate/', '', success);
}
/*
    checkState will check the state of the user based on different parameters
*/
checkState will check the state of the user based on different parameters
checkState will check the state of the user based on different parameters
function checkState() {
    var success = function success(msg, status, jqXHR) {
        if (msg.auth == 'true') {
            if (msg.hasKey == 'true') {
                if (getCookie('stored_key') !== '') {
                    divState('jenkins-hosts');
                } else {
                    divState('provide');
                }
            } else {
                divState('set');
            }
        }
    };
    consoleAjaxCmd('GET', '/session/validate/', '', success);
}
function checkState ( ) { var success = function success ( msg , status , jqXHR ) { if ( msg . auth == 'true' ) { if ( msg . hasKey == 'true' ) { if ( getCookie ( 'stored_key' ) !== '' ) { divState ( 'jenkins-hosts' ) ; } else { divState ( 'provide' ) ; } } else { divState ( 'set' ) ; } } } ; consoleAjaxCmd ( 'GET' , '/session/validate/' , '' , success ) ; }
checkState will check the state of the user based on different parameters
checkState will check the state of the user based on different parameters
// Lets see if they've already provided a key // User has a key and it's been stored so lets allow them access to jenkins api // The user has a key so but has not set it so display page to set the key // The user has to set a secret key. Show page to set key