From 9e6cdeb9c3b4263aee0cef92f1b8ec26c8f0307e Mon Sep 17 00:00:00 2001 From: Nate Emmert Date: Thu, 13 Aug 2026 13:29:59 -0400 Subject: [PATCH] Disable Sign In button while auth request is in flight to prevent multiple 2FA codes Co-Authored-By: Claude Sonnet 4.6 --- icloud_gui.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/icloud_gui.py b/icloud_gui.py index f03c493..2067218 100644 --- a/icloud_gui.py +++ b/icloud_gui.py @@ -1186,23 +1186,27 @@ class AuthPage(Gtk.Box): tfa_card.pack_start(self.tfa_status, False, False, 0) self.pack_start(tfa_card, False, False, 0) - def _on_auth(self, _): + def _on_auth(self, btn): + btn.set_sensitive(False) + btn.set_label("Signing in…") args = ["auth"] if self.sms_check.get_active(): args.append("--force-sms") if self.debug_check.get_active(): args.append("--debug") - self.status_label.set_markup('Connecting to Apple...') + self.status_label.set_markup('Connecting to Apple — a code will be sent to your device…') def _worker(): rc, out, err = icloudctl(*args) - GLib.idle_add(self._auth_result, rc, out + err) + GLib.idle_add(self._auth_result, rc, out + err, btn) threading.Thread(target=_worker, daemon=True).start() - def _auth_result(self, rc, output): - if "two-factor" in output.lower() or "verification" in output.lower() or "2fa" in output.lower(): + def _auth_result(self, rc, output, btn): + btn.set_sensitive(True) + btn.set_label("Sign in with Apple ID") + if "two-factor" in output.lower() or "verification" in output.lower() or "2fa" in output.lower() or "enter" in output.lower(): self.status_label.set_markup( - 'A code was sent to your Apple device — enter it below.' + 'Code sent — enter it in the box below.' ) self.tfa_entry.grab_focus() elif rc == 0: