当托管在 Heroku 上时,我的 Stripe Connect 重定向 URL 出现了一些问题。
在本地运行,一切都按预期工作,用户使用 OAuth 连接,将可发布的密钥保存到数据库,然后通过站点正常进行。
然而,在 Heroku 上,用户通过 OAuth 连接到 Stripe,输入他们的详细信息和密码,然后在重定向时,他们会收到以下错误消息:
Heroku | No such app
There is no app configured at that hostname.
Perhaps the app owner has renamed it, or you mistyped the URL.
到目前为止,该文档没有帮助,我在 Stack Overflow 上也找不到类似的东西。
条纹细节:
生产重定向 URI: https ://www.hidden-hamlet-51741.herokuapp.com/oauth/callback
我玩过一些变化,但没有成功。
Heroku 日志:
2016-03-23T13:23:37.799909+00:00 heroku[router]: at=info method=GET path="/users/auth/stripe_connect" host=hidden-hamlet-51741.herokuapp.com request_id=4d52e646-6d02-45be-87e6-7492665c4d17 fwd="86.138.166.211" dyno=web.1 connect=2ms service=19ms status=302 bytes=1549
2016-03-23T13:23:37.796546+00:00 app[web.1]: Started GET "/users/auth/stripe_connect" for 86.138.166.211 at 2016-03-23 13:23:37 +0000
2016-03-23T13:23:37.799240+00:00 app[web.1]: I, [2016-03-23T13:23:37.799170 #3] INFO -- omniauth: (stripe_connect) Request phase initiated.
2016-03-23T13:30:57.289321+00:00 app[web.1]: Started GET "/users/auth/stripe_connect" for 86.138.166.211 at 2016-03-23 13:30:57 +0000
2016-03-23T13:30:57.306551+00:00 app[web.1]: I, [2016-03-23T13:30:57.306458 #3] INFO -- omniauth: (stripe_connect) Request phase initiated.
2016-03-23T13:30:57.309718+00:00 heroku[router]: at=info method=GET path="/users/auth/stripe_connect" host=hidden-hamlet-51741.herokuapp.com request_id=e7805fd0-3973-4a27-b842-433e1dbb1532 fwd="86.138.166.211" dyno=web.1 connect=2ms service=30ms status=302 bytes=1549
将我的 Production.rb 文件更改为“config.consider_all_requests_local = true”并再次推送到 Heroku 后,收到以下错误消息:
No route matches [GET] "/oauth/callback"
我的 Stripe OAuth 相关路线如下所示:
user_omniauth_authorize GET|POST /users/auth/:provider(.:format) omniauth_callbacks#passthru {:provider=>/stripe_connect/}
user_omniauth_callback GET|POST /users/auth/:action/callback(.:format) omniauth_callbacks#(?-mix:stripe_connect)
stripe_connect GET /stripeconnect(.:format) groups#stripe
任何指针都会非常有帮助。
谢谢。