Skip to content
Snippets Groups Projects
Commit 343ef14c authored by Adrien Béraud's avatar Adrien Béraud
Browse files

OAuth: remember token scope

Change-Id: I5da233b3792215626fd82e827509ef95528e5be8
parent 7c8491ba
No related branches found
No related tags found
No related merge requests found
......@@ -245,6 +245,7 @@ ServerAccountManager::setToken(std::string token, TokenScope scope)
{
std::lock_guard<std::mutex> lock(tokenLock_);
token_ = std::move(token);
tokenScope_ = scope;
nameDir_.get().setToken(token_);
if (not token_.empty()) {
auto& reqQueue = getRequestQueue(scope);
......@@ -374,7 +375,8 @@ ServerAccountManager::searchUser(const std::string& query, SearchCallback cb)
if (response.status_code >= 200 && response.status_code < 300) {
try {
Json::Value::ArrayIndex rcount = json.size();
std::vector<std::map<std::string, std::string>> results(rcount);
std::vector<std::map<std::string, std::string>> results;
results.reserve(rcount);
JAMI_WARN("[Search] Got server response: %s", response.body.c_str());
for (Json::Value::ArrayIndex i=0; i<rcount; i++) {
const auto& ruser = json[i];
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment