1
Fork 0
mirror of https://github.com/redstrate/Astra.git synced 2025-06-08 15:07:45 +00:00

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.
This commit is contained in:
Joshua Goins 2023-10-08 18:20:13 -04:00
parent 7280aa5a48
commit f6c418d7d6

View file

@ -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<QString> 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();