summary refs log tree commit diff
diff options
context:
space:
mode:
authorDeepBlueV7.X <nicolas.werner@hotmail.de>2024-06-20 20:04:53 +0000
committerGitHub <noreply@github.com>2024-06-20 20:04:53 +0000
commit9eac31627a6ecb71a6a8b67d01b78e0919fb62b9 (patch)
treed5a841ab8cfebea0ae2c0abb5fd53b6362063033
parentSkip users we don't share a room with in invite dialog (diff)
parentPlace repeatedPassword after first check & remove unnecessary empty check (diff)
downloadnheko-9eac31627a6ecb71a6a8b67d01b78e0919fb62b9.tar.xz
Merge pull request #1734 from Integral-Tech/confirm-passwd
Add dialog for repeating password when exporting keys
-rw-r--r--src/UserSettingsPage.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/UserSettingsPage.cpp b/src/UserSettingsPage.cpp
index 4f208d22..2172c34c 100644
--- a/src/UserSettingsPage.cpp
+++ b/src/UserSettingsPage.cpp
@@ -2133,6 +2133,20 @@ UserSettingsModel::exportSessionKeys()
         return;
     }
 
+    auto repeatedPassword = QInputDialog::getText(nullptr,
+                                                  tr("Repeat File Password"),
+                                                  tr("Repeat the passphrase:"),
+                                                  QLineEdit::Password,
+                                                  QLatin1String(""),
+                                                  &ok);
+    if (!ok)
+        return;
+
+    if (password != repeatedPassword) {
+        QMessageBox::warning(nullptr, tr("Error"), tr("Passwords don't match"));
+        return;
+    }
+
     // Open file dialog to save the file.
     const QString homeFolder = QStandardPaths::writableLocation(QStandardPaths::HomeLocation);
     const QString fileName   = QFileDialog::getSaveFileName(