简体   繁体   中英

How to stop redirect URL from being wiped by Shopify CLI?

I'm building a Shopify app and everytime I restart my server, the Oauth callback URL that I whitelisted gets removed in Shopify's partner dashboard.

Out of the box, Shopify comes with 3 Oauth URLs:

https://6d57-64-183-178-66.ngrok.io/auth/callback
https://6d57-64-183-178-66.ngrok.io/auth/shopify/callback
https://6d57-64-183-178-66.ngrok.io/api/auth/callback

I needed to add a fourth for my use case:

https://6d57-64-183-178-66.ngrok.io/api/auth/callback/offline

On server restart, the Ngrok URL gets updated which is convenient, however, my URL gets deleted which is not convenient.

So for example, the above example would become the below example on server restart:

https://new-URL.ngrok.io/auth/callback
https://new-URL.ngrok.io/auth/shopify/callback
https://new-URL.ngrok.io/api/auth/callback

I used the Shopify CLI to scaffold this project and have been looking through the codebase to find where the whitelisted urls get updated. However, I have not been able to track down where this is occuring.

Any insights into how I can stop my whitelisted URL from being deleted every server reset?

在此处输入图像描述

If I understand you run your application with

shopify app serve

Instead, what you can do is run

shopify app tunnel start This will just create the tunnel and set the whitelists.

Then to run your app you can run

npm run serve (or npm run dev )

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM