Skip to content

Commit e843c0f

Browse files
capJavertclaude
andcommitted
fix(onboarding): clear stale auth state when abandoning signup flows
- Clear autoTriggerProvider on auth modal close (fixes GitHub OAuth re-triggering after switching to AI flow) - Clear signupContext on all modal close handlers (auth, chooser, prompt) - Route prompt modal close through closeSignupChooser for consistent cleanup Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 66346be commit e843c0f

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

packages/webapp/components/onboarding/OnboardingV2.tsx

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -535,12 +535,15 @@ export const OnboardingV2 = (): ReactElement => {
535535
window.scrollTo({ top: 0, behavior: 'smooth' });
536536
}, [setExtensionSeen]);
537537
const closeSignupChooser = useCallback(() => {
538+
setSignupContext(null);
538539
setStep('hero');
539-
}, []);
540+
}, [setSignupContext]);
540541
const closeAuthSignup = useCallback(() => {
542+
setAutoTriggerProvider(undefined);
543+
setSignupContext(null);
541544
setStep('hero');
542545
setAuthDisplay(AuthDisplay.OnboardingSignup);
543-
}, []);
546+
}, [setSignupContext]);
544547
const openLogin = useCallback(() => {
545548
showLogin({
546549
trigger: AuthTriggers.MainButton,
@@ -2080,7 +2083,7 @@ export const OnboardingV2 = (): ReactElement => {
20802083
>
20812084
<div
20822085
className="absolute inset-0"
2083-
onClick={() => setStep('hero')}
2086+
onClick={closeSignupChooser}
20842087
role="presentation"
20852088
/>
20862089

@@ -2089,7 +2092,7 @@ export const OnboardingV2 = (): ReactElement => {
20892092
{/* Close */}
20902093
<button
20912094
type="button"
2092-
onClick={() => setStep('hero')}
2095+
onClick={closeSignupChooser}
20932096
className="z-10 absolute right-3 top-3 flex h-8 w-8 items-center justify-center rounded-10 text-text-quaternary transition-all duration-200 hover:rotate-90 hover:bg-white/[0.06] hover:text-text-secondary"
20942097
aria-label="Close"
20952098
>

0 commit comments

Comments
 (0)