Skip to content

[Due for payment 2026-09-15] [Verify account] Travel legacy request-access path skips the confirm modal after verification #98065

Description

@mountiny

Follow-up to the audit in issue 72980.

Problem

On the legacy travel request-access path — BookTravelButton.tsx:169-172, reached when BETAS.IS_TRAVEL_VERIFIED is off — the validated branch does two things: it calls requestTravelAccess() and, when shouldShowVerifyAccountModal is true, it shows the "verify company" confirm modal.

After the magic code, only the first of those happens. Travel/VerifyAccountPage.tsx:36 sets the forward route to undefined on that branch:

const navigateForwardTo = isTravelVerifiedBetaEnabled ? (travelProvisioning?.nextStepRoute ?? defaultForwardRoute) : undefined;

requestTravelAccess() does fire through onValidationSuccess, but the confirm modal is skipped and the user is sent back with no feedback. This is a partial continuation rather than a full stop, so it is lower impact than the other flow-stops in the audit.

Solution

Make the legacy branch reproduce the whole validated branch, confirm modal included. The cleanest way is useVerifyAccountAndResume (src/hooks/useVerifyAccountAndResume.ts) in BookTravelButton, so one code path serves both the validated and the just-validated user.

Action Items

  1. Hook the resume: call useVerifyAccountAndResume in BookTravelButton.tsx for the legacy branch.
  2. Resume the full branch: on resume, run requestTravelAccess() and the shouldShowVerifyAccountModal confirm modal, matching lines 173-186.
  3. Simplify the verify page: once the resume covers it, drop the now-unused onValidationSuccess and handleClose overrides from Travel/VerifyAccountPage.tsx.
  4. Do not regress the beta-on path: with IS_TRAVEL_VERIFIED enabled the forward route comes from travelProvisioning?.nextStepRoute and already works. Leave it alone.
  5. Verify: with the beta off and an unvalidated account on an unprovisioned paid workspace, press Book travel, enter the magic code, and confirm the confirm modal appears just as it does for a validated user.

Specific Component to Migrate

BookTravelButton legacy request-access path

  • Current files: src/components/BookTravelButton.tsx, src/pages/Travel/VerifyAccountPage.tsx
  • Reuse: src/hooks/useVerifyAccountAndResume.ts
Issue OwnerCurrent Issue Owner: @aimane-chnaif

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions