From 4e84989d8f6330027327f4fc214055c1cd7bf45b Mon Sep 17 00:00:00 2001
From: Tommaso Sciortino <sciortino@gmail.com>
Date: Mon, 7 Jul 2025 16:27:24 -0700
Subject: Fix double "esc" bug in Auth dialog (#3493)

---
 packages/cli/src/ui/components/AuthDialog.tsx | 5 +++++
 1 file changed, 5 insertions(+)

(limited to 'packages/cli/src/ui/components/AuthDialog.tsx')

diff --git a/packages/cli/src/ui/components/AuthDialog.tsx b/packages/cli/src/ui/components/AuthDialog.tsx
index cea6727f..a33e284d 100644
--- a/packages/cli/src/ui/components/AuthDialog.tsx
+++ b/packages/cli/src/ui/components/AuthDialog.tsx
@@ -66,6 +66,11 @@ export function AuthDialog({
 
   useInput((_input, key) => {
     if (key.escape) {
+      // Prevent exit if there is an error message.
+      // This means they user is not authenticated yet.
+      if (errorMessage) {
+        return;
+      }
       if (settings.merged.selectedAuthType === undefined) {
         // Prevent exiting if no auth method is set
         setErrorMessage(
-- 
cgit v1.2.3

