aboutsummaryrefslogtreecommitdiff
path: root/settings.cpp
diff options
context:
space:
mode:
authorKitsune Ral <Kitsune-Ral@users.sf.net>2017-12-25 14:46:18 +0900
committerKitsune Ral <Kitsune-Ral@users.sf.net>2017-12-25 14:46:18 +0900
commitcbfe29b3435fbe47fee268facbe6a82000fce0ad (patch)
treee922f1a1505ff1d0a3cdaca56ed5fd151c3aa410 /settings.cpp
parentb1dd0e7ea87842fb5ff9deb14beb3474136b06f3 (diff)
parenta4a1129385731c3999a6d5986a24fc069938245c (diff)
downloadlibquotient-cbfe29b3435fbe47fee268facbe6a82000fce0ad.tar.gz
libquotient-cbfe29b3435fbe47fee268facbe6a82000fce0ad.zip
Merge branch 'master' into kitsune-gtad
Diffstat (limited to 'settings.cpp')
-rw-r--r--settings.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/settings.cpp b/settings.cpp
index 68914642..ac9c091c 100644
--- a/settings.cpp
+++ b/settings.cpp
@@ -1,7 +1,8 @@
#include "settings.h"
+#include "logging.h"
+
#include <QtCore/QUrl>
-#include <QtCore/QDebug>
using namespace QMatrixClient;
@@ -19,6 +20,8 @@ void Settings::setValue(const QString& key, const QVariant& value)
{
// qCDebug() << "Setting" << key << "to" << value;
QSettings::setValue(key, value);
+ if (legacySettings.contains(key))
+ legacySettings.remove(key);
}
QVariant Settings::value(const QString& key, const QVariant& defaultValue) const
@@ -133,10 +136,14 @@ QString AccountSettings::accessToken() const
void AccountSettings::setAccessToken(const QString& accessToken)
{
+ qCWarning(MAIN) << "Saving access_token to QSettings is insecure."
+ " Developers, please save access_token separately.";
setValue("access_token", accessToken);
}
void AccountSettings::clearAccessToken()
{
+ legacySettings.remove("access_token");
+ legacySettings.remove("device_id"); // Force the server to re-issue it
remove("access_token");
}