public/assets/js/login.js
// loginUser does a post to our "api/login" route and if successful, redirects us the the members page
loginUser does a post to our "api/login" route and if successful, redirects us the the members page
loginUser does a post to our " api / login " route and if successful redirects us the the members page
function loginUser(username, password) {
        $.post("/api/login", {
            username: username,
            password: password
        })
            .then(function () {
                window.location.replace("/addTrip");
            })
            .fail(function (err) {
                alert("Invalid Username/Passsword!");
                console.log(err);
            });
    }
function loginUser ( username , password ) { $ . post ( "/api/login" , { username : username , password : password } ) . then ( function ( ) { window . location . replace ( "/addTrip" ) ; } ) . fail ( function ( err ) { alert ( "Invalid Username/Passsword!" ) ; console . log ( err ) ; } ) ; }
loginUser does a post to our "api/login" route and if successful, redirects us the the members page
loginUser does a post to our " api / login " route and if successful redirects us the the members page
// If there's an error, log the error