Browse Source

fix: use HTTPS for WooCommerce OAuth callback URL #18

- WooCommerce requires SSL for callback URLs
- Changed callback URL construction to always use https://
- Fixes error: 'The callback_url needs to be over SSL'
Claude 5 months ago
parent
commit
40b920df56
1 changed files with 2 additions and 1 deletions
  1. 2 1
      supabase/functions/oauth-woocommerce/index.ts

+ 2 - 1
supabase/functions/oauth-woocommerce/index.ts

@@ -199,7 +199,8 @@ serve(async (req) => {
       }
       }
 
 
       // Build WooCommerce OAuth authorization URL
       // Build WooCommerce OAuth authorization URL
-      const callbackUrl = `${url.protocol}//${url.host}${url.pathname}?action=callback`
+      // Always use HTTPS for callback URL (WooCommerce requires SSL)
+      const callbackUrl = `https://${url.host}${url.pathname}?action=callback`
       const appName = 'ShopCall.ai'
       const appName = 'ShopCall.ai'
       const returnUrl = `${frontendUrl}/webshops?wc_connected=true`
       const returnUrl = `${frontendUrl}/webshops?wc_connected=true`