From 99d521569d392e660f8dbbb9a50cad9c9062b75b Mon Sep 17 00:00:00 2001
From: Scott Densmore <scottdensmore@mac.com>
Date: Sun, 22 Jun 2025 22:52:25 -0700
Subject: Scotdensmore/first run auth fix (#1322)

---
 packages/cli/src/ui/components/AuthDialog.tsx | 7 +++++++
 1 file changed, 7 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 7ae8b7ee..c0e5d4f8 100644
--- a/packages/cli/src/ui/components/AuthDialog.tsx
+++ b/packages/cli/src/ui/components/AuthDialog.tsx
@@ -78,6 +78,13 @@ export function AuthDialog({
 
   useInput((_input, key) => {
     if (key.escape) {
+      if (settings.merged.selectedAuthType === undefined) {
+        // Prevent exiting if no auth method is set
+        setErrorMessage(
+          'You must select an auth method to proceed. Press Ctrl+C twice to exit.',
+        );
+        return;
+      }
       onSelect(undefined, SettingScope.User);
     }
   });
-- 
cgit v1.2.3

