From f6c418d7d626546c8cda79671d2ee7bbefba8f6b Mon Sep 17 00:00:00 2001 From: Joshua Goins Date: Sun, 8 Oct 2023 18:20:13 -0400 Subject: [PATCH] Ensure Flatpak credentials don't collide with non-Flatpak ones This should never happen because everything is stored via the UUID, but just in case. --- launcher/src/account.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/launcher/src/account.cpp b/launcher/src/account.cpp index c622ecf..87d4eaa 100644 --- a/launcher/src/account.cpp +++ b/launcher/src/account.cpp @@ -266,7 +266,11 @@ void Account::setKeychainValue(const QString &key, const QString &value) { auto job = new QKeychain::WritePasswordJob(QStringLiteral("Astra"), this); job->setTextData(value); +#ifdef FLATPAK + job->setKey(QStringLiteral("flatpak-") + m_key + QStringLiteral("-") + key); +#else job->setKey(m_key + QStringLiteral("-") + key); +#endif job->setInsecureFallback(m_launcher.isSteamDeck()); // The Steam Deck does not have secrets provider in Game Mode job->start(); } @@ -274,7 +278,11 @@ void Account::setKeychainValue(const QString &key, const QString &value) QCoro::Task Account::getKeychainValue(const QString &key) { auto job = new QKeychain::ReadPasswordJob(QStringLiteral("Astra"), this); +#ifdef FLATPAK + job->setKey(QStringLiteral("flatpak-") + m_key + QStringLiteral("-") + key); +#else job->setKey(m_key + QStringLiteral("-") + key); +#endif job->setInsecureFallback(m_launcher.isSteamDeck()); job->start();