portal can handle log in and out correctly using AJAX calls