1
0
mirror of https://gitlab.com/comunic/comunicterm synced 2025-06-19 16:45:17 +00:00

Get current user ID

This commit is contained in:
2020-01-09 13:20:46 +01:00
parent 9488cd27a5
commit 963edbf6e3
2 changed files with 14 additions and 0 deletions

View File

@ -39,6 +39,12 @@ LoginResult AccountHelper::Login(const std::string &email, const std::string &pa
AccountHelper::mToken1 = tokens.at("token1").as_string();
AccountHelper::mToken2 = tokens.at("token2").as_string();
// Get current user ID
auto response = ApiRequest("user/getCurrentUserID", true).exec();
if(response.code() != 200) return ERROR;
AccountHelper::mUserID = response.object().at("userID").as_number().to_int32();
return SUCCESS;
}