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:
parent
7280aa5a48
commit
f6c418d7d6
1 changed files with 8 additions and 0 deletions
|
@ -266,7 +266,11 @@ void Account::setKeychainValue(const QString &key, const QString &value)
|
||||||
{
|
{
|
||||||
auto job = new QKeychain::WritePasswordJob(QStringLiteral("Astra"), this);
|
auto job = new QKeychain::WritePasswordJob(QStringLiteral("Astra"), this);
|
||||||
job->setTextData(value);
|
job->setTextData(value);
|
||||||
|
#ifdef FLATPAK
|
||||||
|
job->setKey(QStringLiteral("flatpak-") + m_key + QStringLiteral("-") + key);
|
||||||
|
#else
|
||||||
job->setKey(m_key + QStringLiteral("-") + key);
|
job->setKey(m_key + QStringLiteral("-") + key);
|
||||||
|
#endif
|
||||||
job->setInsecureFallback(m_launcher.isSteamDeck()); // The Steam Deck does not have secrets provider in Game Mode
|
job->setInsecureFallback(m_launcher.isSteamDeck()); // The Steam Deck does not have secrets provider in Game Mode
|
||||||
job->start();
|
job->start();
|
||||||
}
|
}
|
||||||
|
@ -274,7 +278,11 @@ void Account::setKeychainValue(const QString &key, const QString &value)
|
||||||
QCoro::Task<QString> Account::getKeychainValue(const QString &key)
|
QCoro::Task<QString> Account::getKeychainValue(const QString &key)
|
||||||
{
|
{
|
||||||
auto job = new QKeychain::ReadPasswordJob(QStringLiteral("Astra"), this);
|
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);
|
job->setKey(m_key + QStringLiteral("-") + key);
|
||||||
|
#endif
|
||||||
job->setInsecureFallback(m_launcher.isSteamDeck());
|
job->setInsecureFallback(m_launcher.isSteamDeck());
|
||||||
job->start();
|
job->start();
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue