Commit 6df7ff2e authored by Paweł Wegner's avatar Paweł Wegner
Browse files

Removed placeholder refresh token requests.

parent 96b4e2a1
...@@ -223,14 +223,8 @@ HttpRequest::Pointer Dropbox::Auth::exchangeAuthorizationCodeRequest( ...@@ -223,14 +223,8 @@ HttpRequest::Pointer Dropbox::Auth::exchangeAuthorizationCodeRequest(
return request; return request;
} }
HttpRequest::Pointer Dropbox::Auth::refreshTokenRequest( HttpRequest::Pointer Dropbox::Auth::refreshTokenRequest(std::ostream&) const {
std::ostream& input_data) const { return nullptr;
Dropbox dropbox;
dropbox.auth()->set_access_token(make_unique<Token>(*access_token()));
HttpRequest::Pointer r =
dropbox.listDirectoryRequest(*dropbox.rootDirectory(), "", input_data);
dropbox.authorizeRequest(*r);
return r;
} }
IAuth::Token::Pointer Dropbox::Auth::exchangeAuthorizationCodeResponse( IAuth::Token::Pointer Dropbox::Auth::exchangeAuthorizationCodeResponse(
...@@ -246,7 +240,7 @@ IAuth::Token::Pointer Dropbox::Auth::exchangeAuthorizationCodeResponse( ...@@ -246,7 +240,7 @@ IAuth::Token::Pointer Dropbox::Auth::exchangeAuthorizationCodeResponse(
} }
IAuth::Token::Pointer Dropbox::Auth::refreshTokenResponse(std::istream&) const { IAuth::Token::Pointer Dropbox::Auth::refreshTokenResponse(std::istream&) const {
return make_unique<Token>(*access_token()); return nullptr;
} }
} // namespace cloudstorage } // namespace cloudstorage
...@@ -75,7 +75,7 @@ bool AuthorizeRequest::authorize() { ...@@ -75,7 +75,7 @@ bool AuthorizeRequest::authorize() {
std::unique_lock<std::mutex> lock(provider()->auth_mutex()); std::unique_lock<std::mutex> lock(provider()->auth_mutex());
auth->set_access_token(auth->refreshTokenResponse(output)); auth->set_access_token(auth->refreshTokenResponse(output));
return true; return true;
} else if (!HttpRequest::isClientError(code)) { } else if (r && !HttpRequest::isClientError(code)) {
if (!is_cancelled()) if (!is_cancelled())
provider()->callback()->error(*provider(), provider()->callback()->error(*provider(),
error_string(code, error_stream.str())); error_string(code, error_stream.str()));
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment