function isLoggedIn(callback, params) {
            // request php, check if the user is logged in.
            $.ajax({
                type: "POST",
                url: "./auth/",
                // async: false,
                success: function(data, textStatus, jqXHR) {
                    // allow these params without being logged in
                    if (params == "password" || params == "forgot") {
                        callback(params, true);
                    } else {
                        loadUser(function() {
                            callback(params, data.logged_in);
                        })
                    }
                },
                error: function(jqXHR, textStatus, errorThrown) {
                    console.error("The following error occured: " + textStatus, errorThrown);
                    return false;
                },
                dataType: "json"
            });
        }
// method that checks if the user is logged in or not
method that checks if the user is logged in or not
method that checks if the user is logged in or not
function isLoggedIn(callback, params) {
            $.ajax({
                type: "POST",
                url: "./auth/",
                success: function(data, textStatus, jqXHR) {
                    if (params == "password" || params == "forgot") {
                        callback(params, true);
                    } else {
                        loadUser(function() {
                            callback(params, data.logged_in);
                        })
                    }
                },
                error: function(jqXHR, textStatus, errorThrown) {
                    console.error("The following error occured: " + textStatus, errorThrown);
                    return false;
                },
                dataType: "json"
            });
        }
function isLoggedIn ( callback , params ) { $ . ajax ( { type : "POST" , url : "./auth/" , success : function ( data , textStatus , jqXHR ) { if ( params == "password" || params == "forgot" ) { callback ( params , true ) ; } else { loadUser ( function ( ) { callback ( params , data . logged_in ) ; } ) } } , error : function ( jqXHR , textStatus , errorThrown ) { console . error ( "The following error occured: " + textStatus , errorThrown ) ; return false ; } , dataType : "json" } ) ; }
method that checks if the user is logged in or not
method that checks if the user is logged in or not
// request php, check if the user is logged in. // async: false, // allow these params without being logged in