public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Dominik Csapak <d.csapak@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH proxmox-login-manager 2/2] tfa: allow closing tfa form
Date: Tue,  4 Jul 2023 15:53:18 +0200	[thread overview]
Message-ID: <20230704135318.3278928-2-d.csapak@proxmox.com> (raw)
In-Reply-To: <20230704135318.3278928-1-d.csapak@proxmox.com>

abort the login when the form returns null. This happens if the user
presses 'X' in the tfa form.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
 lib/proxmox_login_form.dart | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/lib/proxmox_login_form.dart b/lib/proxmox_login_form.dart
index dbc912a..861947d 100644
--- a/lib/proxmox_login_form.dart
+++ b/lib/proxmox_login_form.dart
@@ -433,11 +433,21 @@ class _ProxmoxLoginPageState extends State<ProxmoxLoginPage> {
 
       if (client.credentials.tfa != null &&
           client.credentials.tfa!.kinds().length > 0) {
-        client = await Navigator.of(context).push(MaterialPageRoute(
+        ProxmoxApiClient? tfaclient =
+            await Navigator.of(context).push(MaterialPageRoute(
           builder: (context) => ProxmoxTfaForm(
             apiClient: client,
           ),
         ));
+
+        if (tfaclient != null) {
+          client = tfaclient;
+        } else {
+          setState(() {
+            _progressModel.inProgress -= 1;
+          });
+          return;
+        }
       }
 
       final status = await client.getClusterStatus();
-- 
2.30.2





  reply	other threads:[~2023-07-04 13:53 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-04 13:53 [pve-devel] [PATCH proxmox-login-manager 1/2] saved login: don't give outdated ticket to login form Dominik Csapak
2023-07-04 13:53 ` Dominik Csapak [this message]
2023-07-04 15:22 ` [pve-devel] applied-series: " Thomas Lamprecht

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230704135318.3278928-2-d.csapak@proxmox.com \
    --to=d.csapak@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal