Hello,
You could use a a web service (or custom aspx page with few query parameters), directly with JS. Or, you could also use a custom web part (with Display to roles set to __authenticated__) that generates simple input:
<input type="hidden" id="isAuthenticated" />
then, you can check whether the user is authenticated using js:
var x = document.getElementById("isAuthenticated");
if (x != null)
{
// user is authenticated
}
Best Regards,
Edward Hillard