I have a jQuery .get call that hits a URL which returns true or false based on whether the user is signed in or not. This allows me to redirect the user to a login form if they aren’t authenticated rather than the entire page being displayed in a small div (which holds content a signed in user should be able to see)
I think there is a problem with my .get syntax:
$(document).ready( function () {
function logInCheck() {
$.get({{ path('signed_in_check') }}, function(data) {
var loggedIn = data;
alert(loggedIn);
});
}
logInCheck();
});
This doesn’t work, and even if I replace alert(loggedIn) with alert(“hello”), the alert doesn’t get called.
You have bad typos in your code.
It should work for now.