]> git.proxmox.com Git - flutter/proxmox_login_manager.git/commitdiff
login form: fix port autodetection
authorAaron Lauterer <a.lauterer@proxmox.com>
Tue, 25 Apr 2023 09:15:02 +0000 (11:15 +0200)
committerAaron Lauterer <a.lauterer@proxmox.com>
Tue, 25 Apr 2023 09:15:02 +0000 (11:15 +0200)
The port 443 check was not triggered as 'hasPort' was already false.

Only add the port 443 to the IP/Url is the check was successful, otherwise
we leave the entered IP/Url as is. The use will need to fix it before we
can try to connect again.

Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
lib/proxmox_login_form.dart

index e1e172420dd81ee17fb49c5e06f5552e09b42328..8ae81f609f2e1a7eb282953f9d2292cc1b21220f 100644 (file)
@@ -609,7 +609,7 @@ class _ProxmoxLoginPageState extends State<ProxmoxLoginPage> {
     List<PveAccessDomainModel?>? response;
 
     try {
-      response = await _tryGetAccessDomains(apiBaseUrl, !hasPort);
+      response = await _tryGetAccessDomains(apiBaseUrl, hasPort);
       if (!hasPort) {
         _originController.text = '$host:8006';
       }
@@ -618,7 +618,9 @@ class _ProxmoxLoginPageState extends State<ProxmoxLoginPage> {
         // we were no port given, and we couldn't reach on port 8006, retry with 443
         apiBaseUrl = apiBaseUrl.replace(port: 443);
         response = await _tryGetAccessDomains(apiBaseUrl, true);
-        _originController.text = '$host:443';
+        if (response != null) {
+          _originController.text = '$host:443';
+        }
       }
     }