Added conditional to api key login.