login/logout async logic