The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.
Rust agent-orchestrationai-agentsai-assistantdesktopllmlocal-firstmcppersonal-aiprivacyrustsecond-braintauri
feat(oauth): confirm before switching away from a local profile
Steven Enamakeld5268929dcd9
diff --git a/app/src/components/oauth/OAuthProviderButton.tsx b/app/src/components/oauth/OAuthProviderButton.tsxindex 2a946578bb..d02be68069 100644--- a/app/src/components/oauth/OAuthProviderButton.tsx+++ b/app/src/components/oauth/OAuthProviderButton.tsx@@ -17,12 +17,23 @@ import { startLoopbackOauthListener } from '../../utils/loopbackOauthListener';import { prepareOAuthLoginLaunch } from '../../utils/oauthAppVersionGate';import { openUrl } from '../../utils/openUrl';import { isTauri } from '../../utils/tauriCommands';+import {+ AlertDialogAction,+ AlertDialogCancel,+ AlertDialogContent,+ AlertDialogDescription,+ AlertDialogFooter,+ AlertDialogRoot,+ AlertDialogTitle,+} from '../ui/AlertDialog';interface OAuthProviderButtonProps {provider: OAuthProviderConfig;className?: string;disabled?: boolean;onClickOverride?: () => void;+ /** Local profile whose data will remain on this device after cloud sign-in. */+ localProfileId?: string | null;}// Reset the loading state if the OAuth round-trip never completes — covers@@ -110,10 +121,12 @@ const OAuthProviderButton = ({className = '',disabled: externalDisabled = false,onClickOverride,+ localProfileId,}: OAuthProviderButtonProps) => {const { t } = useT();const [isLoading, setIsLoading] = useState(false);const [startupError, setStartupError] = useState<string | null>(null);+ const [confirmProfileSwitch, setConfirmProfileSwitch] = useState(false);// Tracks whether the user actually got dispatched to the system browser on// this attempt. Lets the focus/visibility handlers distinguish "user came// back from the browser" (probe for backend health) from "click never even@@ -212,7 +225,7 @@ const OAuthProviderButton = ({};}, [isLoading, provider.id]);- const handleOAuthLogin = async () => {+ const startOAuthLogin = async () => {if (onClickOverride) {onClickOverride();return;@@ -367,6 +380,14 @@ const OAuthProviderButton = ({}};+ const handleOAuthLogin = async () => {+ if (localProfileId?.startsWith('local-')) {+ setConfirmProfileSwitch(true);+ return;+ }+ await startOAuthLogin();+ };+const isDisabled = externalDisabled || isLoading;const IconComponent = provider.icon;@@ -390,6 +411,26 @@ const OAuthProviderButton = ({{startupError}</p>) : null}+ <AlertDialogRoot open={confirmProfileSwitch} onOpenChange={setConfirmProfileSwitch}>+ <AlertDialogContent className="max-w-md">+ <AlertDialogTitle>{t('auth.profileSwitch.title')}</AlertDialogTitle>+ <AlertDialogDescription>+ {t('auth.profileSwitch.body', { profileId: localProfileId ?? '' })}+ </AlertDialogDescription>+ <AlertDialogFooter>+ <AlertDialogCancel>{t('common.cancel')}</AlertDialogCancel>+ <AlertDialogAction+ tone="default"+ onClick={event => {+ event.preventDefault();+ setConfirmProfileSwitch(false);+ void startOAuthLogin();+ }}>+ {t('auth.profileSwitch.continue')}+ </AlertDialogAction>+ </AlertDialogFooter>+ </AlertDialogContent>+ </AlertDialogRoot></div>);};