Actually save the access token after generation.
This commit is contained in:
parent
2554779759
commit
70d3bcfb70
|
@ -15,6 +15,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "config.hpp"
|
#include "config.hpp"
|
||||||
|
|
||||||
#include "exceptions.hpp"
|
#include "exceptions.hpp"
|
||||||
|
|
||||||
#include <boost/log/trivial.hpp>
|
#include <boost/log/trivial.hpp>
|
||||||
|
@ -217,7 +218,6 @@ string Config::get_access_token(const string &instance) const
|
||||||
if (ret)
|
if (ret)
|
||||||
{
|
{
|
||||||
string code;
|
string code;
|
||||||
string access_token;
|
|
||||||
|
|
||||||
cout << "Visit " << ret << " to authorize this application.\n";
|
cout << "Visit " << ret << " to authorize this application.\n";
|
||||||
cout << "Insert code: ";
|
cout << "Insert code: ";
|
||||||
|
@ -225,8 +225,8 @@ string Config::get_access_token(const string &instance) const
|
||||||
ret = token.step_2(code);
|
ret = token.step_2(code);
|
||||||
if (ret)
|
if (ret)
|
||||||
{
|
{
|
||||||
BOOST_LOG_TRIVIAL(debug) << "Got access token.";
|
BOOST_LOG_TRIVIAL(debug) << "Got access token: " << ret.body;
|
||||||
return access_token;
|
return ret.body;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -243,8 +243,8 @@ void Config::parse()
|
||||||
profiledata.instance = _json[profile]["instance"].asString();
|
profiledata.instance = _json[profile]["instance"].asString();
|
||||||
if (!_json[profile]["interval"].isNull())
|
if (!_json[profile]["interval"].isNull())
|
||||||
{
|
{
|
||||||
profiledata.interval =
|
profiledata.interval = static_cast<uint32_t>(
|
||||||
static_cast<uint32_t>(_json[profile]["interval"].asUInt64());
|
_json[profile]["interval"].asUInt64());
|
||||||
}
|
}
|
||||||
profiledata.keep_looking = _json[profile]["keep_looking"].asBool();
|
profiledata.keep_looking = _json[profile]["keep_looking"].asBool();
|
||||||
if (!_json[profile]["max_size"].isNull())
|
if (!_json[profile]["max_size"].isNull())
|
||||||
|
@ -274,8 +274,8 @@ void Config::write()
|
||||||
_json[profile]["instance"] = profiledata.instance;
|
_json[profile]["instance"] = profiledata.instance;
|
||||||
_json[profile]["interval"] = profiledata.interval;
|
_json[profile]["interval"] = profiledata.interval;
|
||||||
_json[profile]["keep_looking"] = profiledata.keep_looking;
|
_json[profile]["keep_looking"] = profiledata.keep_looking;
|
||||||
_json[profile]["max_size"] =
|
_json[profile]["max_size"] = static_cast<Json::Value::UInt64>(
|
||||||
static_cast<Json::Value::UInt64>(profiledata.max_size);
|
profiledata.max_size);
|
||||||
_json[profile]["skip"] = stringlist_to_jsonarray(profiledata.skip);
|
_json[profile]["skip"] = stringlist_to_jsonarray(profiledata.skip);
|
||||||
_json[profile]["titles_as_cw"] = profiledata.titles_as_cw;
|
_json[profile]["titles_as_cw"] = profiledata.titles_as_cw;
|
||||||
_json[profile]["titles_only"] = profiledata.titles_only;
|
_json[profile]["titles_only"] = profiledata.titles_only;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user