Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,10 @@ function DynamicSuccessPage({route}: DynamicSuccessPageProps) {
const isIncompleteOnboarding = hasCompletedGuidedSetupFlow === false;
const hasSavedOnboardingPath = !!onboardingInitialPath?.includes(`/${ROUTES.ONBOARDING_ROOT.route}`);
// Forced onboarding 2FA always enters via Settings > Security (from the require-2FA overlay).
const isForcedOnboardingHandoff = AccountUtils.isForced2FAOnboardingSetup(account, false) || (!!account?.requiresTwoFactorAuth && isIncompleteOnboarding && hasSavedOnboardingPath);
// Gate on the real hasCompletedGuidedSetupFlow so the handoff only fires for users who haven't finished
// guided setup; passing a literal false made it fire for every user setting up 2FA from Settings > Security.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❌ CONSISTENCY-16 (docs)

The added comment joins two independent statements with a semicolon ("...who haven't finished guided setup; passing a literal false made it fire for every user setting up 2FA from Settings > Security."). Per the plain-comment-style rule, use two separate sentences instead of a semicolon so the comment reads as natural prose.

Split it into two sentences, for example:

// Gate on the real hasCompletedGuidedSetupFlow so the handoff only fires for users who haven't finished
// guided setup. Passing a literal false made it fire for every user setting up 2FA from Settings > Security.

Reviewed at: 8b09fd5 | Please rate this suggestion with 👍 or 👎 to help us improve! Reactions are used to monitor reviewer efficiency.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The CONSISTENCY-16 finding is valid — the added comment joins two independent statements with a semicolon, which the plain-comment-style rule says to split into two sentences. The suggested fix is correct:

// Gate on the real hasCompletedGuidedSetupFlow so the handoff only fires for users who haven't finished
// guided setup. Passing a literal false made it fire for every user setting up 2FA from Settings > Security.

I can only make code changes when directed by the PR author, an assignee, or an existing co-author. To have me implement this, the PR assignee or author should reply with a request tagging me.

const isForcedOnboardingHandoff =
AccountUtils.isForced2FAOnboardingSetup(account, !!hasCompletedGuidedSetupFlow) || (!!account?.requiresTwoFactorAuth && isIncompleteOnboarding && hasSavedOnboardingPath);
const shouldReturnToOnboardingAfter2FA = isSecuritySettingsFlow && isForcedOnboardingHandoff;

const completeForcedOnboarding2FAHandoff = () => {
Expand Down
Loading