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(
return request;
}
HttpRequest::Pointer Dropbox::Auth::refreshTokenRequest(
std::ostream& input_data) const {
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;
HttpRequest::Pointer Dropbox::Auth::refreshTokenRequest(std::ostream&) const {
return nullptr;
}
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 {
return make_unique<Token>(*access_token());
return nullptr;
}
} // namespace cloudstorage
......@@ -75,7 +75,7 @@ bool AuthorizeRequest::authorize() {
std::unique_lock<std::mutex> lock(provider()->auth_mutex());
auth->set_access_token(auth->refreshTokenResponse(output));
return true;
} else if (!HttpRequest::isClientError(code)) {
} else if (r && !HttpRequest::isClientError(code)) {
if (!is_cancelled())
provider()->callback()->error(*provider(),
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