prefs: cloud_new_password is not a preference

It's a mamber of the cloud storage authentication class, used to hold the
proposed new password until the backend has accepted it.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2018-09-10 06:49:14 -07:00
parent ae653703a5
commit 2b3f6c607b
9 changed files with 4 additions and 45 deletions

View file

@ -26,6 +26,7 @@ QNetworkReply* CloudStorageAuthenticate::backend(const QString& email,const QStr
} else if (!newpasswd.isEmpty()) {
requestUrl = QUrl(CLOUDBACKENDUPDATE);
payload += QChar(' ') + newpasswd;
cloudNewPassword = newpasswd;
} else {
requestUrl = QUrl(CLOUDBACKENDVERIFY);
payload += QChar(' ') + pin;
@ -64,8 +65,8 @@ void CloudStorageAuthenticate::uploadFinished()
report_error(qPrintable(tr("Cloud account verification required, enter PIN in preferences")));
} else if (cloudAuthReply == QLatin1String("[PASSWDCHANGED]")) {
free((void *)prefs.cloud_storage_password);
prefs.cloud_storage_password = prefs.cloud_storage_newpassword;
prefs.cloud_storage_newpassword = NULL;
prefs.cloud_storage_password = strdup(qPrintable(cloudNewPassword));
cloudNewPassword.clear();
emit passwordChangeSuccessful();
return;
} else {