如何阻止重定向URL被Shopify CLI擦拭?

发布于 2025-02-14 00:52:44 字数 931 浏览 1 评论 0原文

我正在构建一个Shopify应用程序,每次重新启动服务器时,我将其白色列出的OAuth回调URL都会在Shopify的合作伙伴仪表板中删除。

开箱即用,Shopify带有3个OAuth URL:

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

我需要为我的用例添加第四个网址:

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

在服务器重新启动时,Ngrok URL更新,这很方便,但是,我的URL被删除了,这并不方便。

因此,例如,上面的示例将成为服务器重新启动的下面示例:

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

我使用Shopify CLI脚手架脚手架,并一直在浏览代码库以查找白色列出的URL更新的位置。但是,我无法追踪发生这种情况的地方。

关于如何阻止白名单的URL被删除每个服务器重置的任何见解?

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?

enter image description here

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

泼猴你往哪里跑 2025-02-21 00:52:45

如果我了解您使用

Shopify App服务

运行您的应用程序,那么您可以做的就是运行

Shopify App Tunnel start这只会创建隧道并设置白名单。

然后,要运行您的应用程序,您可以运行

npm运行服务(或npm Run dev

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)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文