code format

This commit is contained in:
keita
2022-04-23 18:04:03 +09:00
parent 136700d154
commit 611cfc2e31
52 changed files with 391 additions and 350 deletions
+9 -11
View File
@@ -1,18 +1,16 @@
#include <cocoatweet/api/oauth2/token.h>
#include "nlohmann/json.hpp"
namespace CocoaTweet::API::OAuth2 {
Token::Token() {
contentType_ = "application/x-www-form-urlencoded";
url_ = "https://api.twitter.com/oauth2/token";
namespace CocoaTweet::API::OAuth2{
Token::Token(){
contentType_ = "application/x-www-form-urlencoded";
url_ = "https://api.twitter.com/oauth2/token";
bodyParam_.insert_or_assign("grant_type", "client_credentials");
}
bodyParam_.insert_or_assign("grant_type", "client_credentials");
}
const std::string Token::process(std::weak_ptr<CocoaTweet::Authentication::AuthenticatorBase> _oauth) {
const std::string Token::process(
std::weak_ptr<CocoaTweet::Authentication::AuthenticatorBase> _oauth) {
auto basic = std::make_shared<CocoaTweet::Authentication::Basic>(_oauth.lock()->key());
std::string bearer = "";
HttpPost::process(basic, [&bearer](const std::string& _rcv) {
@@ -22,4 +20,4 @@ const std::string Token::process(std::weak_ptr<CocoaTweet::Authentication::Authe
return bearer;
}
}
} // namespace CocoaTweet::API::OAuth2