mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-05 07:35:12 -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
1 changed files with 5 additions and 5 deletions
|
@ -180,6 +180,7 @@ JsonApiServer::JsonApiServer(): configMutex("JsonApiServer config"),
|
||||||
std::string errorMessage;
|
std::string errorMessage;
|
||||||
bool makeHidden = false;
|
bool makeHidden = false;
|
||||||
bool makeAutoTor = false;
|
bool makeAutoTor = false;
|
||||||
|
std::string createToken;
|
||||||
|
|
||||||
// deserialize input parameters from JSON
|
// deserialize input parameters from JSON
|
||||||
{
|
{
|
||||||
|
@ -189,6 +190,7 @@ JsonApiServer::JsonApiServer(): configMutex("JsonApiServer config"),
|
||||||
RS_SERIAL_PROCESS(password);
|
RS_SERIAL_PROCESS(password);
|
||||||
RS_SERIAL_PROCESS(makeHidden);
|
RS_SERIAL_PROCESS(makeHidden);
|
||||||
RS_SERIAL_PROCESS(makeAutoTor);
|
RS_SERIAL_PROCESS(makeAutoTor);
|
||||||
|
RS_SERIAL_PROCESS(createToken);
|
||||||
}
|
}
|
||||||
|
|
||||||
// call retroshare C++ API
|
// call retroshare C++ API
|
||||||
|
@ -196,8 +198,9 @@ JsonApiServer::JsonApiServer(): configMutex("JsonApiServer config"),
|
||||||
location, password, errorMessage, makeHidden,
|
location, password, errorMessage, makeHidden,
|
||||||
makeAutoTor );
|
makeAutoTor );
|
||||||
|
|
||||||
if(retval)
|
std::string tokenUser, tokenPw;
|
||||||
authorizeUser(location.mLocationId.toStdString(),password);
|
if(retval && parseToken(createToken, tokenUser, tokenPw))
|
||||||
|
authorizeUser(tokenUser,tokenPw);
|
||||||
|
|
||||||
// serialize out parameters and return value to JSON
|
// serialize out parameters and return value to JSON
|
||||||
{
|
{
|
||||||
|
@ -238,9 +241,6 @@ JsonApiServer::JsonApiServer(): configMutex("JsonApiServer config"),
|
||||||
RsInit::LoadCertificateStatus retval =
|
RsInit::LoadCertificateStatus retval =
|
||||||
rsLoginHelper->attemptLogin(account, password);
|
rsLoginHelper->attemptLogin(account, password);
|
||||||
|
|
||||||
if( retval == RsInit::OK )
|
|
||||||
authorizeUser(account.toStdString(), password);
|
|
||||||
|
|
||||||
// serialize out parameters and return value to JSON
|
// serialize out parameters and return value to JSON
|
||||||
{
|
{
|
||||||
RsGenericSerializer::SerializeContext& ctx(cAns);
|
RsGenericSerializer::SerializeContext& ctx(cAns);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue