Fix location creation via JSON API

To complete location creation login is needed
This commit is contained in:
Gioacchino Mazzurco 2018-08-25 00:19:26 +02:00
parent afb92999d8
commit b98246ee21
No known key found for this signature in database
GPG Key ID: A1FBCA3872E87051

View File

@ -1988,13 +1988,18 @@ bool RsLoginHelper::createLocation(
return false;
}
std::string sslPassword =
RSRandom::random_alphaNumericString(RsInit::getSslPwdLen());
if(!rsNotify->cachePgpPassphrase(password)) return false;
if(!rsNotify->setDisableAskPassword(true)) return false;
bool ret = RsAccounts::createNewAccount(
l.mPgpId, "", l.mLocationName, "", makeHidden, makeAutoTor,
RSRandom::random_alphaNumericString(RsInit::getSslPwdLen()),
l.mLocationId, errorMessage );
sslPassword, l.mLocationId, errorMessage );
ret = ret && RsInit::LoadPassword(sslPassword);
ret = ret && RsInit::OK == attemptLogin(l.mLocationId, password);
rsNotify->setDisableAskPassword(false);
return ret;