Ver código fonte

fix: redirect to landing page when no integration params present #97

When users navigate directly to /integrations without any shop integration
parameters, redirect them to the landing page (/) instead of showing a
perpetual loading state.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Claude 5 meses atrás
pai
commit
e4625f6c23
1 arquivos alterados com 14 adições e 0 exclusões
  1. 14 0
      shopcall.ai-main/src/pages/IntegrationsRedirect.tsx

+ 14 - 0
shopcall.ai-main/src/pages/IntegrationsRedirect.tsx

@@ -47,6 +47,20 @@ export default function IntegrationsRedirect() {
         return;
         return;
       }
       }
 
 
+      // Check if any valid integration parameters are present
+      // If not, redirect to landing page
+      const hasShopRenterParams = srInstall && shopname;
+      // Future: Add checks for other platforms here
+      // const hasShopifyParams = ...
+      // const hasWooCommerceParams = ...
+
+      if (!hasShopRenterParams) {
+        // No valid integration parameters found, redirect to landing page
+        console.log('[Integrations] No valid integration parameters found, redirecting to landing page');
+        navigate('/');
+        return;
+      }
+
       // Detect ShopRenter installation
       // Detect ShopRenter installation
       if (srInstall && shopname) {
       if (srInstall && shopname) {
         // If we have HMAC parameters, validate them first
         // If we have HMAC parameters, validate them first