File tree Expand file tree Collapse file tree
components/authorization/authGuard Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -38,15 +38,14 @@ export const ProtectedRoute = ({ children }) => {
3838 const isRootPage = currentPath === "/" ;
3939 const isFlowsPage = currentPath . includes ( "/flows" ) ;
4040 const isPricingPage = currentPath . includes ( "/pricing" ) ;
41+ const pricingBypassSearch = new URLSearchParams ( currentSearch ) ;
4142 const hasPricingBypassParam =
42- new URLSearchParams ( currentSearch ) . get ( "pricing_bypass" ) === "1" ;
43+ pricingBypassSearch . get ( "pricing_bypass" ) === "1" ||
44+ pricingBypassSearch . get ( "pricingBypass" ) === "1" ;
4345 const hasPricingBypassSession =
4446 sessionStorage . getItem ( "pricingBypass" ) === "1" ;
4547 const isPricingBypass =
46- isFlowsPage &&
47- ( hasPricingBypassParam || hasPricingBypassSession ) &&
48- isSignedIn === true &&
49- isOrgSelected ;
48+ isFlowsPage && ( hasPricingBypassParam || hasPricingBypassSession ) ;
5049
5150 // 🔹 Billing state
5251 const [ hasAccess , setHasAccess ] = useState < boolean | null > ( null ) ;
@@ -146,16 +145,17 @@ export const ProtectedRoute = ({ children }) => {
146145 return null ;
147146 }
148147
149- if ( isSignedIn && ! isOrgSelected ) {
150- return < CustomNavigate to = "/organization" replace /> ;
151- }
152-
153148 if ( isPricingBypass ) {
154149 // Temporary bypass from pricing placeholder until checkout is implemented
155- } else if ( isSignedIn && hasAccess === null ) {
156- return null ;
157- }
150+ } else {
151+ if ( isSignedIn && ! isOrgSelected ) {
152+ return < CustomNavigate to = "/organization" replace /> ;
153+ }
158154
155+ if ( isSignedIn && hasAccess === null ) {
156+ return null ;
157+ }
158+ }
159159 if ( isCheckingAccess ) {
160160 return null ;
161161 }
Original file line number Diff line number Diff line change @@ -266,15 +266,14 @@ export default function PricingPage() {
266266 </ div >
267267
268268 < div className = "mt-8 flex justify-center" >
269- < button
269+ < button
270270 type = "button"
271271 onClick = { ( ) => {
272- sessionStorage . setItem ( "pricingBypass" , "1" ) ;
273- navigate ( "/flows" ) ;
272+ navigate ( "/flows?pricingBypass=1" ) ;
274273 } }
275274 className = "mr-3 rounded-lg border border-cyan-300/40 px-4 py-2 text-sm"
276275 >
277- Temporary: Go to flows
276+ Go to flows
278277 </ button >
279278 < button
280279 type = "button"
You can’t perform that action at this time.
0 commit comments