refactored api client initialization in post_login_<provider> tasks