| 146 | } |
| 147 | |
| 148 | AuthCookieResult GetAuthCookie(std::string& cookie_out) |
| 149 | { |
| 150 | std::ifstream file; |
| 151 | fs::path filepath = GetAuthCookieFile(); |
| 152 | if (filepath.empty()) { |
| 153 | return AuthCookieResult::Disabled; // -norpccookiefile |
| 154 | } |
| 155 | file.open(filepath.std_path()); |
| 156 | if (!file.is_open()) { |
| 157 | return AuthCookieResult::Error; |
| 158 | } |
| 159 | std::getline(file, cookie_out); |
| 160 | file.close(); |
| 161 | return AuthCookieResult::Ok; |
| 162 | } |
| 163 | |
| 164 | void DeleteAuthCookie() |
| 165 | { |
no test coverage detected