| 259 | } |
| 260 | |
| 261 | void OAuthService::AuthoriseRefreshToken( |
| 262 | const ServiceConfig& config, std::string_view token, AudiocomTrace trace, |
| 263 | std::function<void(std::string_view)> completedHandler, bool silent) |
| 264 | { |
| 265 | using namespace rapidjson; |
| 266 | |
| 267 | Document document; |
| 268 | document.SetObject(); |
| 269 | |
| 270 | WriteCommonFields(document, "refresh_token", ""); |
| 271 | |
| 272 | document.AddMember( |
| 273 | "refresh_token", StringRef(token.data(), token.size()), |
| 274 | document.GetAllocator()); |
| 275 | |
| 276 | rapidjson::StringBuffer buffer; |
| 277 | rapidjson::Writer<rapidjson::StringBuffer> writer(buffer); |
| 278 | document.Accept(writer); |
| 279 | |
| 280 | DoAuthorise( |
| 281 | config, { buffer.GetString(), buffer.GetSize() }, trace, |
| 282 | std::move(completedHandler), silent); |
| 283 | } |
| 284 | |
| 285 | void OAuthService::AuthoriseRefreshToken( |
| 286 | const ServiceConfig& config, AudiocomTrace trace, |