CLOUD: Change interaction with /refresh endpoint

Refresh token is now passed as custom HTTP header, not in GET parameter,
to prevent them being written into server logs.
This commit is contained in:
Alexander Tkachev 2019-07-26 11:40:52 +07:00 committed by Matan Bareket
parent e7ca2b8db0
commit 85431c39bf

View File

@ -139,8 +139,9 @@ void BaseStorage::refreshAccessToken(BoolCallback callback, Networking::ErrorCal
if (errorCallback == nullptr)
errorCallback = getErrorPrintingCallback();
Common::String url = Common::String::format("https://cloud.scummvm.org/%s/refresh?code=%s", cloudProvider().c_str(), _refreshToken.c_str());
Common::String url = Common::String::format("https://cloud.scummvm.org/%s/refresh", cloudProvider().c_str());
Networking::CurlJsonRequest *request = new Networking::CurlJsonRequest(innerCallback, errorCallback, url);
request->addHeader("X-ScummVM-Refresh-Token: " + _refreshToken);
addRequest(request);
}