| 358 | } |
| 359 | |
| 360 | std::string OAuthService::MakeAudioComAuthorizeURL(std::string_view userId, std::string_view redirectUrl) |
| 361 | { |
| 362 | auto token = GetAccessToken(); |
| 363 | |
| 364 | // Remove token type from the token string |
| 365 | size_t pos = token.find(' '); |
| 366 | if (pos != std::string::npos) { |
| 367 | token = token.substr(pos + 1); |
| 368 | } |
| 369 | |
| 370 | std::string url = concat( |
| 371 | GetServiceConfig().GetAuthWithRedirectURL(), "?", |
| 372 | tokenPrefix, token, "&", |
| 373 | userPrefix, userId, "&", |
| 374 | urlPrefix, audacity::UrlEncode(redirectUrl) |
| 375 | ); |
| 376 | |
| 377 | if (SendAnonymousUsageInfo->Read()) { |
| 378 | url += concat(std::string_view("&"), instanceIdPrefix, InstanceId->Read()); |
| 379 | } |
| 380 | |
| 381 | return url; |
| 382 | } |
| 383 | |
| 384 | void OAuthService::Authorize(std::string_view email, |
| 385 | std::string_view password, |
no test coverage detected