mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2024-10-01 01:26:01 -04:00
Passkeys: Fix duplicate database selection
This commit is contained in:
parent
6f11422604
commit
41d00135af
@ -666,7 +666,8 @@ QJsonObject BrowserService::showPasskeysRegisterPrompt(const QJsonObject& public
|
||||
userId,
|
||||
publicKeyCredentials.key);
|
||||
} else {
|
||||
addPasskeyToGroup(nullptr,
|
||||
addPasskeyToGroup(db,
|
||||
nullptr,
|
||||
origin,
|
||||
rpId,
|
||||
rpName,
|
||||
@ -689,7 +690,7 @@ QJsonObject BrowserService::showPasskeysAuthenticationPrompt(const QJsonObject&
|
||||
const QString& origin,
|
||||
const StringPairList& keyList)
|
||||
{
|
||||
auto db = selectedDatabase();
|
||||
auto db = getDatabase();
|
||||
if (!db) {
|
||||
return getPasskeyError(ERROR_KEEPASS_DATABASE_NOT_OPENED);
|
||||
}
|
||||
@ -738,7 +739,8 @@ QJsonObject BrowserService::showPasskeysAuthenticationPrompt(const QJsonObject&
|
||||
return getPasskeyError(ERROR_PASSKEYS_REQUEST_CANCELED);
|
||||
}
|
||||
|
||||
void BrowserService::addPasskeyToGroup(Group* group,
|
||||
void BrowserService::addPasskeyToGroup(const QSharedPointer<Database>& db,
|
||||
Group* group,
|
||||
const QString& url,
|
||||
const QString& rpId,
|
||||
const QString& rpName,
|
||||
@ -749,7 +751,6 @@ void BrowserService::addPasskeyToGroup(Group* group,
|
||||
{
|
||||
// If no group provided, use the default browser group of the selected database
|
||||
if (!group) {
|
||||
auto db = selectedDatabase();
|
||||
if (!db) {
|
||||
return;
|
||||
}
|
||||
|
@ -94,7 +94,8 @@ public:
|
||||
QJsonObject showPasskeysAuthenticationPrompt(const QJsonObject& publicKeyOptions,
|
||||
const QString& origin,
|
||||
const StringPairList& keyList);
|
||||
void addPasskeyToGroup(Group* group,
|
||||
void addPasskeyToGroup(const QSharedPointer<Database>& db,
|
||||
Group* group,
|
||||
const QString& url,
|
||||
const QString& rpId,
|
||||
const QString& rpName,
|
||||
|
@ -152,7 +152,7 @@ void PasskeyImporter::showImportDialog(QSharedPointer<Database>& database,
|
||||
}
|
||||
|
||||
browserService()->addPasskeyToGroup(
|
||||
group, url, relyingParty, relyingParty, username, credentialId, userHandle, privateKey);
|
||||
db, group, url, relyingParty, relyingParty, username, credentialId, userHandle, privateKey);
|
||||
}
|
||||
|
||||
Group* PasskeyImporter::getDefaultGroup(QSharedPointer<Database>& database) const
|
||||
|
Loading…
Reference in New Issue
Block a user