Skip to content

Commit

Permalink
Keep saved username/password between connects
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
CendioOssman committed Nov 4, 2024
1 parent a62b575 commit 4341fca
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions vncviewer/UserDialog.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
4 changes: 2 additions & 2 deletions vncviewer/UserDialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ class UserDialog
void resetPassword();

private:
std::string savedUsername;
std::string savedPassword;
static std::string savedUsername;
static std::string savedPassword;
};

#endif

0 comments on commit 4341fca

Please sign in to comment.