diff options
author | jsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68> | 2012-05-28 04:39:18 +0000 |
---|---|---|
committer | jsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68> | 2012-05-28 04:39:18 +0000 |
commit | f278315081b24b59bf73e9613e552e3519200a71 (patch) | |
tree | cdfe0e8d00e2c3e8002284c4541429f91cb66e68 /sca-cpp/trunk/modules/oauth/mod-oauth1.cpp | |
parent | c3eb9d1e20e1f8a7a101854d6a883692cac4e8d0 (diff) |
Improve error reporting with a reason code. Improve debug and audit logging. Fix test scripts to cleanup state from previous builds and correctly report test errors.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1343138 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to '')
-rw-r--r-- | sca-cpp/trunk/modules/oauth/mod-oauth1.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sca-cpp/trunk/modules/oauth/mod-oauth1.cpp b/sca-cpp/trunk/modules/oauth/mod-oauth1.cpp index b927315393..eb23443491 100644 --- a/sca-cpp/trunk/modules/oauth/mod-oauth1.cpp +++ b/sca-cpp/trunk/modules/oauth/mod-oauth1.cpp @@ -235,7 +235,7 @@ const failable<int> authorize(const list<list<value> >& args, request_rec* r, co // Store the request token in memcached const failable<bool> prc = memcache::put(mklist<value>("tuscanyOAuth1Token", cadr(tv)), cadr(sv), mc); if (!hasContent(prc)) - return mkfailure<int>(reason(prc)); + return mkfailure<int>(prc); // Redirect to the authorize URI const string authuri = httpd::unescape(cadr(auth)) + string("?") + http::queryString(mklist<list<value> >(tv)); @@ -327,7 +327,7 @@ const failable<int> accessToken(const list<list<value> >& args, request_rec* r, // Retrieve the request token from memcached const failable<value> sv = memcache::get(mklist<value>("tuscanyOAuth1Token", cadr(tv)), mc); if (!hasContent(sv)) - return mkfailure<int>(reason(sv)); + return mkfailure<int>(sv); // Build and sign access token request URI const string tokuri = httpd::unescape(cadr(tok)) + string("?") + http::queryString(mklist<list<value> >(vv)); @@ -374,13 +374,13 @@ const failable<int> accessToken(const list<list<value> >& args, request_rec* r, // Retrieve the user info from the profile const failable<list<value> > iv = profileUserInfo(cadr(cid), profres); if (!hasContent(iv)) - return mkfailure<int>(reason(iv)); + return mkfailure<int>(iv); // Store user info in memcached keyed by session ID const value sid = string("OAuth1_") + mkrand(); const failable<bool> prc = memcache::put(mklist<value>("tuscanyOAuth1", sid), content(iv), mc); if (!hasContent(prc)) - return mkfailure<int>(reason(prc)); + return mkfailure<int>(prc); // Send session ID to the client in a cookie debug(c_str(openauth::cookie("TuscanyOAuth1", sid, httpd::hostName(r))), "modoauth1::access_token::setcookie"); |