Redirect After Install (Node/Express/React App)

New Member
1 0 0

Hey all!

 

I've been building an app following the documentation for Shopify, and it all seems to be working fine, but there's one bug I've been trying to fix now for a while... I've seen this question on here before but couldn't find an answer that worked for me.

 

I'm trying to get it so the app doesn't redirect outside of Shopify to my (currently) ngrok URL upon initial install. (Though after install and manually redirecting back to the admin panel, it opens in the frame just fine -- it's the install that's the issue).  I'm using the React App Bridge and passing in the configs and forceRedirect boolean to the provider (I also tried doing this with Polaris AppProvider), but no dice (not even sure if this would affect this -- just kept seeing on here that App Bridge might be able to solve this issue).

 

I also tried just doing a `res.redirect` in my node server after the authentication to this kind of thing that I've seen on here:

 

CUSTOMERS_SHOP.myshopify.com/admin/apps/API_KEY

That should actually work, but I think in this case we would have to whitelist every single customers shop who happened to download the app - doesn't seem ideal! :) 

 

Even the docs (https://developers.shopify.com/tutorials/build-a-shopify-app-with-node-and-react/embed-your-app-in-s...) seem to have this app popping up out of the frame upon initial install so I'm not sure if maybe this is expected behavior... is there any way to have it come up inside the frame? Thanks!

0 Likes
Highlighted
Shopify Staff
Shopify Staff
481 62 72

Hey @jessica221,

 

That should actually work, but I think in this case we would have to whitelist every single customers shop who happened to download the app - doesn't seem ideal! :) 

Given it's a standard redirect (not part of the OAuth flow), you wont need to whitelist every customer's shop. Give it a shot, let me know if you get stuck!

0 Likes