Skip to content

Commit 398c991

Browse files
Fix: gate forced 2FA onboarding handoff on real hasCompletedGuidedSetupFlow
Co-authored-by: Rory Abraham <roryabraham@users.noreply.github.com>
1 parent c958866 commit 398c991

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/pages/settings/Security/TwoFactorAuth/DynamicSuccessPage.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,9 @@ function DynamicSuccessPage({route}: DynamicSuccessPageProps) {
5656
const isIncompleteOnboarding = hasCompletedGuidedSetupFlow === false;
5757
const hasSavedOnboardingPath = !!onboardingInitialPath?.includes(`/${ROUTES.ONBOARDING_ROOT.route}`);
5858
// Forced onboarding 2FA always enters via Settings > Security (from the require-2FA overlay).
59-
const isForcedOnboardingHandoff = AccountUtils.isForced2FAOnboardingSetup(account, false) || (!!account?.requiresTwoFactorAuth && isIncompleteOnboarding && hasSavedOnboardingPath);
59+
// Gate on the real hasCompletedGuidedSetupFlow so the handoff only fires for users who haven't finished
60+
// guided setup; passing a literal false made it fire for every user setting up 2FA from Settings > Security.
61+
const isForcedOnboardingHandoff = AccountUtils.isForced2FAOnboardingSetup(account, !!hasCompletedGuidedSetupFlow) || (!!account?.requiresTwoFactorAuth && isIncompleteOnboarding && hasSavedOnboardingPath);
6062
const shouldReturnToOnboardingAfter2FA = isSecuritySettingsFlow && isForcedOnboardingHandoff;
6163

6264
const completeForcedOnboarding2FAHandoff = () => {

0 commit comments

Comments
 (0)