Make login/logout work fully