[connections/gnome-42] rdp-connection: Reset credentials on connection error



commit dd16c96ae8e50d251f6f886e7c415adf8994a9c6
Author: Felipe Borges <felipeborges gnome org>
Date:   Thu Apr 7 12:37:53 2022 +0200

    rdp-connection: Reset credentials on connection error

 src/rdp-connection.vala | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)
---
diff --git a/src/rdp-connection.vala b/src/rdp-connection.vala
index e8fde6e..84213e8 100644
--- a/src/rdp-connection.vala
+++ b/src/rdp-connection.vala
@@ -70,7 +70,7 @@ namespace Connections {
             display.bind_property ("username", this, "username", BindingFlags.BIDIRECTIONAL);
             display.bind_property ("password", this, "password", BindingFlags.BIDIRECTIONAL);
 
-            display.rdp_error.connect (on_connection_error_cb);
+            display.rdp_error.connect (on_rdp_connection_error_cb);
             display.rdp_connected.connect (() => { show (); });
             //display.rdp_needs_authentication.connect (on_rdp_auth_credential_cb);
             display.rdp_auth_failure.connect (auth_failed);
@@ -131,6 +131,15 @@ namespace Connections {
 
             handle_auth ();
         }
+
+        private void on_rdp_connection_error_cb (string reason) {
+            disconnect_it ();
+
+            delete_auth_credentials.begin ();
+            username = password = null;
+
+            on_connection_error_cb (reason);
+        }
     }
 
     private class FrdpDisplay : Frdp.Display {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]