]> source.dussan.org Git - tigervnc.git/commitdiff
Keep saved username/password between connects
authorPierre Ossman <ossman@cendio.se>
Mon, 4 Nov 2024 12:03:43 +0000 (13:03 +0100)
committerPierre Ossman <ossman@cendio.se>
Mon, 4 Nov 2024 12:03:43 +0000 (13:03 +0100)
The UserDialog object is now only created for a single connection at a
time, which means we need to make sure the cached username and password
survive until the subsequent object.

vncviewer/UserDialog.cxx
vncviewer/UserDialog.h

index b3840d62dc4ebc6913e75baf1c3dcaab05e73867..ed75a53c46d6eeb408b28312a047926d61b6e43d 100644 (file)
@@ -57,6 +57,9 @@ using namespace rfb;
 static Fl_Pixmap secure_icon(secure);
 static Fl_Pixmap insecure_icon(insecure);
 
+std::string UserDialog::savedUsername;
+std::string UserDialog::savedPassword;
+
 static long ret_val = 0;
 
 static void button_cb(Fl_Widget *widget, long val) {
index c16923c12886910739cd5b7ee49c3278934e52f1..ddafbc3c25bda6ab4832331be7aadf00c4845ef6 100644 (file)
@@ -38,8 +38,8 @@ public:
   void resetPassword();
 
 private:
-  std::string savedUsername;
-  std::string savedPassword;
+  static std::string savedUsername;
+  static std::string savedPassword;
 };
 
 #endif