diff --git a/include/api.h b/include/api.h index e79dc71..be4916c 100644 --- a/include/api.h +++ b/include/api.h @@ -70,7 +70,6 @@ size_t writeMemoryCallback(char *ptr, size_t size, size_t nmemb, void *userp); class API { public: - apiConfig config; userDetails user; API(const std::string& token,const std::string& secret, const bool& verbose = false, const bool& bVerifyPeer = true); @@ -88,9 +87,12 @@ class API void clearError(); bool getError() { return this->error; }; std::string getErrorMessage() { return this->error_message; }; + std::string getToken() { return this->config.oauth_token; }; + std::string getSecret() { return this->config.oauth_secret; }; virtual ~API(); protected: private: + apiConfig config; CURL* curlhandle; void setError(const std::string& err); bool error; diff --git a/src/downloader.cpp b/src/downloader.cpp index 74e6c4a..6c71832 100644 --- a/src/downloader.cpp +++ b/src/downloader.cpp @@ -120,7 +120,7 @@ int Downloader::login() std::ofstream ofs(config.sConfigFilePath.c_str()); if (ofs) { - ofs << "token = " << gogAPI->config.oauth_token << std::endl << "secret = " << gogAPI->config.oauth_secret << std::endl; + ofs << "token = " << gogAPI->getToken() << std::endl << "secret = " << gogAPI->getSecret() << std::endl; ofs.close(); return 0; }