From f75b681a0e525d3a5dd7419abaab5f994f3b8137 Mon Sep 17 00:00:00 2001 From: ghost2023 Date: Tue, 4 Aug 2026 17:37:41 +0300 Subject: [PATCH] fix(freight-portal): add /callback route for Fayda redirects --- apps/edr-freight-web/portal/package.json | 2 +- apps/edr-freight-web/portal/src/App.tsx | 1 + .../onboarding/OnboardingWizardDialog.tsx | 15 ++++++++++++++- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/apps/edr-freight-web/portal/package.json b/apps/edr-freight-web/portal/package.json index 9582058ef..f3b493aca 100644 --- a/apps/edr-freight-web/portal/package.json +++ b/apps/edr-freight-web/portal/package.json @@ -4,7 +4,7 @@ "private": true, "type": "module", "scripts": { - "dev": "vite --port 5173 --clearScreen false", + "dev": "vite --port 3000 --clearScreen false", "build": "tsc -b && vite build", "preview": "vite preview --port 5173", "lint": "eslint src", diff --git a/apps/edr-freight-web/portal/src/App.tsx b/apps/edr-freight-web/portal/src/App.tsx index f1715f740..48cfe5203 100644 --- a/apps/edr-freight-web/portal/src/App.tsx +++ b/apps/edr-freight-web/portal/src/App.tsx @@ -267,6 +267,7 @@ const App = () => { to the page that started it. Public on purpose: behind RequireAuth the onboarding gate would redirect away before the exchange ran. */} } /> + } /> } /> } /> diff --git a/apps/edr-freight-web/portal/src/components/onboarding/OnboardingWizardDialog.tsx b/apps/edr-freight-web/portal/src/components/onboarding/OnboardingWizardDialog.tsx index 466307fe9..fa9c5919b 100644 --- a/apps/edr-freight-web/portal/src/components/onboarding/OnboardingWizardDialog.tsx +++ b/apps/edr-freight-web/portal/src/components/onboarding/OnboardingWizardDialog.tsx @@ -209,7 +209,20 @@ export default function OnboardingWizardDialog({ nationality?: CompanyNationality; }) => api.companies.startOnboarding.call(vars), onSuccess: async () => { - await refreshInfo(); + // Nationality drives the server-resolved identity requirements (Fayda vs + // passport), the document set and the GM/PoA copy — all read from + // onboardingRequirements/profile. Re-entering role selection can change + // it, so both must be refetched alongside getInfo or the form step would + // keep rendering the previous nationality's requirements. + await Promise.all([ + refreshInfo(), + queryClient.invalidateQueries({ + queryKey: api.companies.onboardingRequirements.queryKey(), + }), + queryClient.invalidateQueries({ + queryKey: api.companies.getProfile.queryKey(), + }), + ]); setPhase("form"); }, onError: (err) => setStartError(extractApiError(err).message),