mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-03-18 13:06:10 -04:00
Merge pull request #2006 from sehraf/pr_remove_rs_pw_as_token
remove retroshare password from json tokens
This commit is contained in:
commit
f456389580
@ -180,6 +180,7 @@ JsonApiServer::JsonApiServer(): configMutex("JsonApiServer config"),
|
||||
std::string errorMessage;
|
||||
bool makeHidden = false;
|
||||
bool makeAutoTor = false;
|
||||
std::string createToken;
|
||||
|
||||
// deserialize input parameters from JSON
|
||||
{
|
||||
@ -189,6 +190,7 @@ JsonApiServer::JsonApiServer(): configMutex("JsonApiServer config"),
|
||||
RS_SERIAL_PROCESS(password);
|
||||
RS_SERIAL_PROCESS(makeHidden);
|
||||
RS_SERIAL_PROCESS(makeAutoTor);
|
||||
RS_SERIAL_PROCESS(createToken);
|
||||
}
|
||||
|
||||
// call retroshare C++ API
|
||||
@ -196,8 +198,9 @@ JsonApiServer::JsonApiServer(): configMutex("JsonApiServer config"),
|
||||
location, password, errorMessage, makeHidden,
|
||||
makeAutoTor );
|
||||
|
||||
if(retval)
|
||||
authorizeUser(location.mLocationId.toStdString(),password);
|
||||
std::string tokenUser, tokenPw;
|
||||
if(retval && parseToken(createToken, tokenUser, tokenPw))
|
||||
authorizeUser(tokenUser,tokenPw);
|
||||
|
||||
// serialize out parameters and return value to JSON
|
||||
{
|
||||
@ -238,9 +241,6 @@ JsonApiServer::JsonApiServer(): configMutex("JsonApiServer config"),
|
||||
RsInit::LoadCertificateStatus retval =
|
||||
rsLoginHelper->attemptLogin(account, password);
|
||||
|
||||
if( retval == RsInit::OK )
|
||||
authorizeUser(account.toStdString(), password);
|
||||
|
||||
// serialize out parameters and return value to JSON
|
||||
{
|
||||
RsGenericSerializer::SerializeContext& ctx(cAns);
|
||||
|
Loading…
x
Reference in New Issue
Block a user