fix: handle username/password parsing for Monero node URIs with fallback to query parameters (#2510)

Konstantin Ullrich committed Sep 8, 2025 at 17:26 UTC c83f5a265327bc6d0692adcab0500dd5f676c0e5
1 file changed +9 -4
lib/view_model/node_list/node_create_or_edit_view_model.dart
+9 -4
@@ -243,13 +243,18 @@ abstract class NodeCreateOrEditViewModelBase with Store {
243 throw Exception('Invalid QR code: Unable to parse or missing host.');
244 }
245
246 - final userInfo = uri.userInfo;
247 - final rpcUser = userInfo.length == 2 ? userInfo[0] : '';
248 - final rpcPassword = userInfo.length == 2 ? userInfo[1] : '';
246 final ipAddress = uri.host;
247 final port = uri.hasPort ? uri.port.toString() : '';
248 final path = uri.path;
252 - final queryParams = uri.queryParameters; // Currently not used
249 + final userInfo = uri.userInfo;
250 + var rpcUser = userInfo.length == 2 ? userInfo[0] : '';
251 + var rpcPassword = userInfo.length == 2 ? userInfo[1] : '';
252 +
253 + if (uri.scheme == "monero_node" && rpcUser.isEmpty && rpcPassword.isEmpty) {
254 + final queryParams = uri.queryParameters;
255 + rpcUser = queryParams['username'] ?? '';
256 + rpcPassword = queryParams['password'] ?? '';
257 + }
258
259 await Future.delayed(Duration(milliseconds: 345));
260