From 2ba1c716fa687d1c4830d92f0e4ca5b17621e8d8 Mon Sep 17 00:00:00 2001 From: xavierchanth Date: Fri, 8 Dec 2023 20:58:08 -0500 Subject: [PATCH] fix: dart client authentication --- .../util/ssh_session_handler/dart_ssh_session_handler.dart | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/noports_core/lib/src/sshnp/util/ssh_session_handler/dart_ssh_session_handler.dart b/packages/noports_core/lib/src/sshnp/util/ssh_session_handler/dart_ssh_session_handler.dart index e38164d38..b028c47a5 100644 --- a/packages/noports_core/lib/src/sshnp/util/ssh_session_handler/dart_ssh_session_handler.dart +++ b/packages/noports_core/lib/src/sshnp/util/ssh_session_handler/dart_ssh_session_handler.dart @@ -158,7 +158,8 @@ class SshClientHelper { } try { - await client.authenticated.catchError((e) => throw e); + // Ensure we are connected and authenticated correctly + await client.ping().catchError((e) => throw e); } catch (e, s) { throw SshnpError( 'Failed to authenticate as $username@$host:$port : $e',