Added Ajax authentication listener to stop AJAX calls redirecting to the login.