public function user($username, $response) { if ($response['code'] === 200) { $this->response_body = $response['body']; } else { return Error::invalid_credentials($username . ' with password [FILTERED]'); } }
public function authenticate($username, $password) { $response = $this->apollo->access_token($username, $password); if (is_wp_error($response)) { return Error::cannot_connect_to_auth_server(); } else { $login = new Login(); return $login->user($username, $response); } }