| 37 | // ── Platform-specific paths ───────────────────────────────────────────── |
| 38 | |
| 39 | static std::string GetConfigDir() { |
| 40 | #ifdef _WIN32 |
| 41 | wchar_t* appDataPath = nullptr; |
| 42 | if (SUCCEEDED(SHGetKnownFolderPath(FOLDERID_RoamingAppData, 0, nullptr, &appDataPath))) { |
| 43 | int len = WideCharToMultiByte(CP_UTF8, 0, appDataPath, -1, nullptr, 0, nullptr, nullptr); |
| 44 | std::string result(len - 1, '\0'); |
| 45 | WideCharToMultiByte(CP_UTF8, 0, appDataPath, -1, result.data(), len, nullptr, nullptr); |
| 46 | CoTaskMemFree(appDataPath); |
| 47 | return result + "\\CloudRedirect\\"; |
| 48 | } |
| 49 | return ""; |
| 50 | #else |
| 51 | return XdgConfigHome() + "/CloudRedirect/"; |
| 52 | #endif |
| 53 | } |
| 54 | |
| 55 | static std::string GetTokenPath(const std::string& provider) { |
| 56 | std::string configDir = GetConfigDir(); |
no test coverage detected