mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-26 18:42:49 +00:00
fix(freight-portal): add /callback route for Fayda redirects
This commit is contained in:
@@ -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",
|
||||
|
||||
@@ -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. */}
|
||||
<Route path="/fayda/callback" element={<FaydaCallbackPage />} />
|
||||
<Route path="/callback" element={<FaydaCallbackPage />} />
|
||||
<Route path="/payment/success" element={<PaymentSuccessPage />} />
|
||||
<Route path="/payment/failure" element={<PaymentFailurePage />} />
|
||||
|
||||
|
||||
@@ -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),
|
||||
|
||||
Reference in New Issue
Block a user