From f73b9c2e40bfe142d975ceeff476010f09cab86f Mon Sep 17 00:00:00 2001 From: Loic Stankovic Date: Mon, 26 Oct 2020 18:43:06 +0100 Subject: [PATCH] Fix a bug with OAuth10Credentials::fromJSON This commit fixes compilation issues on MacOS and Windows described in issue #51. --- libs/ofxHTTP/src/OAuth10Credentials.cpp | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/libs/ofxHTTP/src/OAuth10Credentials.cpp b/libs/ofxHTTP/src/OAuth10Credentials.cpp index 5f28219..43db9d0 100644 --- a/libs/ofxHTTP/src/OAuth10Credentials.cpp +++ b/libs/ofxHTTP/src/OAuth10Credentials.cpp @@ -94,12 +94,17 @@ OAuth10Credentials OAuth10Credentials::fromJSON(const ofJson& json) const auto& key = iter.key(); const auto& value = iter.value(); - if (key == "consumerKey") credentials._consumerKey = value; - else if (key == "consumerSecret" || key == "consumer_secret") credentials._consumerSecret = value; - else if (key == "accessToken" || key == "access_token") credentials._accessToken = value; - else if (key == "accessTokenSecret" || key == "access_token_secret") credentials._accessTokenSecret = value; - else if (key == "owner") credentials._owner = value; - else if (key == "ownerId" || key == "owner_id" ) credentials._ownerId = value; + if (key == "consumerKey") credentials._consumerKey = value.get(); + else if (key == "consumerSecret" || key == "consumer_secret") + credentials._consumerSecret = value.get(); + else if (key == "accessToken" || key == "access_token") + credentials._accessToken = value.get(); + else if (key == "accessTokenSecret" || key == "access_token_secret") + credentials._accessTokenSecret = value.get(); + else if (key == "owner") + credentials._owner = value.get(); + else if (key == "ownerId" || key == "owner_id") + credentials._ownerId = value.get(); else ofLogWarning("Credentials::fromJSON") << "Unknown key: " << key << std::endl << value.dump(4); ++iter; }