[connections/fix-auth-when-it-fails: 3/3] connection: Handle authentication failures
- From: Felipe Borges <felipeborges src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [connections/fix-auth-when-it-fails: 3/3] connection: Handle authentication failures
- Date: Tue, 18 May 2021 13:12:59 +0000 (UTC)
commit 49702c0cf83175bd87137251d542a4a792c6297a
Author: Felipe Borges <felipeborges gnome org>
Date: Tue May 18 15:11:20 2021 +0200
connection: Handle authentication failures
Fixes #17
src/connection.vala | 11 +++++++++++
src/vnc-connection.vala | 6 ++++--
2 files changed, 15 insertions(+), 2 deletions(-)
---
diff --git a/src/connection.vala b/src/connection.vala
index e7d0d2f..1d2c5e4 100644
--- a/src/connection.vala
+++ b/src/connection.vala
@@ -146,6 +146,17 @@ namespace Connections {
need_username);
}
+ protected void auth_failed (string reason) {
+ disconnect_it ();
+
+ username = password = null;
+
+ auth_notification = null;
+ var message = _("Authentication failed: %s").printf (reason);
+ Application.application.main_window.notifications_bar.display_for_error (message);
+ Application.application.main_window.show_collection_view ();
+ }
+
construct {
thumbnailer = new Connections.Thumbnailer (this);
diff --git a/src/vnc-connection.vala b/src/vnc-connection.vala
index 1edcee4..4befaa0 100644
--- a/src/vnc-connection.vala
+++ b/src/vnc-connection.vala
@@ -201,8 +201,10 @@ namespace Connections {
connected = false;
}
- private void on_vnc_auth_failure_cb (string message) {
- debug ("Failed to authenticate %s", message);
+ private void on_vnc_auth_failure_cb (string reason) {
+ debug ("Failed to authenticate %s", reason);
+
+ auth_failed (reason);
}
public void scale () {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]