From c83f5a265327bc6d0692adcab0500dd5f676c0e5 Mon Sep 17 00:00:00 2001 From: Konstantin Ullrich Date: Mon, 8 Sep 2025 17:26:14 +0200 Subject: [PATCH] fix: handle username/password parsing for Monero node URIs with fallback to query parameters (#2510) --- .../node_list/node_create_or_edit_view_model.dart | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/lib/view_model/node_list/node_create_or_edit_view_model.dart b/lib/view_model/node_list/node_create_or_edit_view_model.dart index 003247a40..a73bd76fd 100644 --- a/lib/view_model/node_list/node_create_or_edit_view_model.dart +++ b/lib/view_model/node_list/node_create_or_edit_view_model.dart @@ -243,13 +243,18 @@ abstract class NodeCreateOrEditViewModelBase with Store { throw Exception('Invalid QR code: Unable to parse or missing host.'); } - final userInfo = uri.userInfo; - final rpcUser = userInfo.length == 2 ? userInfo[0] : ''; - final rpcPassword = userInfo.length == 2 ? userInfo[1] : ''; final ipAddress = uri.host; final port = uri.hasPort ? uri.port.toString() : ''; final path = uri.path; - final queryParams = uri.queryParameters; // Currently not used + final userInfo = uri.userInfo; + var rpcUser = userInfo.length == 2 ? userInfo[0] : ''; + var rpcPassword = userInfo.length == 2 ? userInfo[1] : ''; + + if (uri.scheme == "monero_node" && rpcUser.isEmpty && rpcPassword.isEmpty) { + final queryParams = uri.queryParameters; + rpcUser = queryParams['username'] ?? ''; + rpcPassword = queryParams['password'] ?? ''; + } await Future.delayed(Duration(milliseconds: 345));