shopOrigin forceRedirect: true yet ngrok urls persist clientside

Solved
Excursionist
33 4 1

I'm making a POST request in my dev shop: 

//data
const metafieldInput = {¬
  "metafield": {¬
    "namespace": "customProductMetafields",¬
    "key": "productDetails",¬
    "value": detail,¬
    "value_type": "json_string"¬
  }¬
};¬
//request
axios.post( '/admin/metafields.json', {¬
  metafieldInput¬
})¬
 .then(function (response) {¬
  console.log(response);¬
})¬
.catch(function (error) {¬
  console.log(error);¬
});

Yet the shopOrigin forceRedirect doesn't seem to be working, or I don't have it applied properly, because the request is sent to 123.ngrok.io and not store.myshopify.com. 

 

This is a development store with a public app. The setup was followed from the Create a Shopify App with React and Node provided by Shopify.Screen Shot 2019-10-29 at 3.07.07 PM.png

 

You are phoenix
0 Likes
Highlighted
Excursionist
33 4 1

bumping as I'm still stumped on this.

You are phoenix
0 Likes
Highlighted

Success.

Shopify Staff
Shopify Staff
607 82 89

Hey @jenn11,

 

Force redirect detects if your app was loaded inside an iframe. If not, it will create a redirection back into the relative embedded URL in the Shopify admin.

 

To post the request to the myshopify url, you'll need to add the Shop to the URL like this.

0 Likes
Highlighted
Excursionist
33 4 1

Apologies for the delayed acceptance, I was learning out your answer :)

You are phoenix
0 Likes