From b2e5f5811966ae249a1bc888f588fac11bbca526 Mon Sep 17 00:00:00 2001
From: Roba Boru
Date: Fri, 17 Jul 2026 22:41:03 +0300
Subject: [PATCH] Enable skip fayda for dev
---
.../src/app/booking/passengers/page.tsx | 31 ++++++++++++++-----
1 file changed, 23 insertions(+), 8 deletions(-)
diff --git a/apps/edr-passenger-web/portal/src/app/booking/passengers/page.tsx b/apps/edr-passenger-web/portal/src/app/booking/passengers/page.tsx
index 7dccc7bdf..b29a4b102 100644
--- a/apps/edr-passenger-web/portal/src/app/booking/passengers/page.tsx
+++ b/apps/edr-passenger-web/portal/src/app/booking/passengers/page.tsx
@@ -685,6 +685,19 @@ function PassengersForm() {
const { user, isAuthenticated, updateUser } = useAuthStore();
const isInitialized = useAuthStore((s) => s.isInitialized);
const [faydaEnabled, setFaydaEnabled] = useState(true);
+ // "Skip for now" (bypasses Fayda verification) is only offered on local dev and the
+ // staging/test domain — never on an unrecognized host, which would include production.
+ // Starts false (matches SSR, where window isn't available) and is only ever flipped to
+ // true client-side after mount, so there's no server/client hydration mismatch.
+ const [allowSkipFaydaVerification, setAllowSkipFaydaVerification] = useState(false);
+ useEffect(() => {
+ const hostname = window.location.hostname;
+ setAllowSkipFaydaVerification(
+ hostname === "localhost" ||
+ hostname === "127.0.0.1" ||
+ hostname === "edrpassenger.triaplc.com",
+ );
+ }, []);
const [verificationStatus, setVerificationStatus] = useState>({});
const [faydaErrors, setFaydaErrors] = useState>({});
// The passenger currently mid-verification (popup open / awaiting callback). Only one
@@ -1166,14 +1179,16 @@ function PassengersForm() {
Finish verifying Passenger {(verifyingIndex ?? 0) + 1} first
)}
- {/* */}
+ {allowSkipFaydaVerification && (
+
+ )}
) : showManualEntryLink ? (